Re: select() weirdness
Re: select() weirdness
- Subject: Re: select() weirdness
- From: Quinn <email@hidden>
- Date: Fri, 25 Feb 2005 15:48:52 +0000
At 7:19 -0800 25/2/05, Steve Dekorte wrote:
I'm calling select() with a timeout of 0 and it usually returns
immediately, but every few thousand calls, it will hang for a few
seconds or more (up to about a 20 seconds!). The read and write
fdset sizes are always 4.
Does anyone know what could be causing this?
select is implemented by the BSD subsystem. Concurrency control in
the BSD subsystem (at least prior to Tiger) is controlled by two
funnels (giant mutexen), one for networking and another for the rest
of the kernel. It could be that your call to select is being held up
behind another thread doing something expensive while holding one of
the BSD funnels.
My guess is that you could debug this using Shark (run Shark's
sampling profiler, then stop it programmatically when you notice a
long latency select; failing that, the "chudKDebugTrace.h" looks
mighty interesting), but I don't have time to research the details
today.
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden