• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: select() weirdness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: select() weirdness
      • From: Steve Dekorte <email@hidden>
References: 
 >select() weirdness (From: Steve Dekorte <email@hidden>)

  • Prev by Date: select() weirdness
  • Next by Date: KEV_DL_IF_DETACHED/KEV_DL_IF_ATTACHED: how to?
  • Previous by thread: select() weirdness
  • Next by thread: Re: select() weirdness
  • Index(es):
    • Date
    • Thread