EPOLL_CTL_DISABLE and multithreaded applications
Posted Oct 19, 2012 15:35 UTC (Fri) by
mkerrisk (subscriber, #1978)
In reply to:
EPOLL_CTL_DISABLE and multithreaded applications by kjp
Parent article:
EPOLL_CTL_DISABLE and multithreaded applications
But if I had multiple threads calling epoll, I think the solution I outlined would work fine. I don't see what else I would need the cookie for... as long as its still doing its job, pointing to a real data structure of mine.
Yes, but other people may want to use the cookie in a quite different way, and it seems a shame to limit the generality of the API by requiring it to be used for this task.
And the nice thing is, it works with all epoll modes. What's very distasteful about the kernel patch is that it requires ONESHOT (yuck!).
Yes, requiring the use of EPOLLONESHOT is rather unfortunate. I strongly suspect that there could be a solution quite similar to the EPOLL_CTL_DISABLE approach that doesn't require EPOLLONESHOT. I have something in mind, but I need to think about it a little more.
(
Log in to post comments)