Run loops: Mach messages vs. kqueues
Run loops: Mach messages vs. kqueues
- Subject: Run loops: Mach messages vs. kqueues
- From: Dave Keck <email@hidden>
- Date: Tue, 19 Jan 2010 23:38:38 -1000
Hello,
Is there a reason that CFRunLoop is implemented atop Mach messages
rather than a kqueue? If it were implemented atop a kqueue, not only
would CFRunLoop maintain support for waking when a Mach message
arrives, but it could also be awoken when data is available on an
arbitrary file descriptor. (As far as I'm aware, the only way to do
this currently is to spawn a secondary thread to monitor the
descriptor and message the original thread to wake it.)
It seems a kqueue-CFRunLoop would improve efficiency quite a bit at no
cost; I've written a lot of code that uses the secondary thread
technique, and I know there's a lot of system APIs that do the same
(CFFileDescriptor and CFSocket to name a few.)
I did notice that kqueues just gained support for monitoring Mach
messages in 10.6 though, so perhaps CFRunLoop has just been waiting
for support in the kernel?
Thanks for any insight!
David
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden