Run loops: Mach messages vs. kqueues
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=hZIPdeKDTUTHx7KMvgP0soLfS6P+xPOWND/jVxv75yU=; b=sn5JRd7xQ3gLQLSulov5M+RZEo3qA15QoPeyes6y8dsY4TVba0vkMOEOiIpvZ5twvi kJS0lkKHKyepw4FXG8N60IU8ihgDUPVqLCzJgIz4hlKexMYK4wjw9fcE3STQFy3x+8Ko suool2PA80NQKKBUiBX0rYbiaxT1EZ6JykJAw= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:from:date:x-google-sender-auth:message-id :subject:to:content-type; b=dg5KdS34v39xBmr8nBsA3w9SUqF0Oq2XKhpm7qWm9fOUpenraZa0GLW0VOp5DYNi5Z pfgCRG88akU40nIfPDDPOUMS6xrijlnv5hSyd0RoMngpByj0Eds9QnffzKPFumY9YxNU dIZHDpiATGo+YMe1/nQIOaezdC/okpJcI1TEQ= 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 (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Dave Keck