LWN.net Logo

EPOLL_CTL_DISABLE and multithreaded applications

EPOLL_CTL_DISABLE and multithreaded applications

Posted Oct 30, 2012 0:23 UTC (Tue) by normalperson (subscriber, #47508)
In reply to: EPOLL_CTL_DISABLE and multithreaded applications by wahern
Parent article: EPOLL_CTL_DISABLE and multithreaded applications

I agree ONESHOT is awesome for MT and probably should've been the default.

epoll_wait() already returns ONESHOT events in FIFO order based on my reading of fs/eventpoll.c (and my own testing/experience). kqueue also seems to return in FIFO order with ONESHOT.

I wrote a server based on this behavior (along with concurrent calls to epoll_wait(...,maxevents=1,...)) for getting fair distribution between threads stuck in I/O wait a while back: http://bogomips.org/cmogstored.git


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds