Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question regarding event queue and select() ...



On Sunday, March 31, 2002, at 08:16 PM, email@hidden wrote:

Hello, all ...

While this question deals with DSS4, i'm posting it to darwin-dev 'cuz it has to do mostly with the lower level sockets stuff i.e. select(), recv() and the event queue. If this is the wrong place to post, kindly illuminate me -- I don't want to waste anyone's bandwidth.

Anyway, is the OSX event queue part of Darwin i.e. watchevent(), waitevent(), modwatch()? The last time I played with DSS, it was v2 on Linux, so select() was used. Now i'm trying to get familiar with DSS4 on Darwin / OSX, so now I get to get all funky and jiggy with the event queue. What do these APIs give me over select()? Do they scale better with regards to CPU usage or something?

The theory is that they scale a lot better than select, in that you only pay a performance hit for the file descriptors that are active. In addition, you can essential splice the event queue code into a select-using app by replacing the select code. The usage is very close; but instead of having to look through a potentially large bit mask, you get a single file descriptor to use in your next operation. The return info from the call gives you enough state to determine what you should do next.

Currently, this is only functional for sockets; Jim may have more to say about the general case.

Cheers,

Justin

--
Justin C. Walker, Curmudgeon-At-Large *
Institute for General Semantics | If you're not confused,
| You're not paying attention
*--------------------------------------*-------------------------------*
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.

References: 
 >Question regarding event queue and select() ... (From: email@hidden)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.