[libdispatch-dev] Why polling event sources with a kevent receiving queue of size 1?

Kevin Van Vechten kvv at apple.com
Mon Jul 19 08:40:46 PDT 2010


On Jul 19, 2010, at 3:52 AM, cee1 wrote:

> I've noticed libdispatch will poll event sources with an one-entry kevent receiving queue(queue_kevent.c:162, in function " _dispatch_mgr_invoke"). This will incurs more system calls and hence poorer performance. Why not poll event sources with a larger kevent receiving queue?

No specific reason other than being an optimization which has not been done yet. While it should be a pretty straightforward optimization, I think there are a couple edge cases we need to consider first to ensure that an incoming kevent can't "resurrect" a dispatch source object already scheduled for disposal on the manager queue.

Kevin


More information about the libdispatch-dev mailing list