Re: ::select() and threads question, hopefully posed better :-)
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On Apr 11, 2007, at 12:41 PM, jmzorko@mac.com wrote: <snip> ml_set_interrupts_enabled thread_block_reason thread_block uiomove selprocess select -josh _______________________________________________ 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 I said, "self, I don't know what that is, but let's see if it calls something that I do know about." So I followed the arrows, and this is what Shark told me: ... so the nature of my question is this: if 60% of the time my program is running is spent in the above, how can I optimize it? Or am I interpreting the output of Shark correctly (for instance, does ml_set_interrupts_enabled call thread_block_reason which calls thread_block, or vice versa)? That means that 60% of the time shark stepped in to sample your thread, it was blocked doing nothing. If all you're concerned about is reducing CPU, try to increase the % of samples that catch your thread in thread_block. The longer a thread is stuck in thread_block, the less CPU it will use. In general, that's where the thread goes to twiddle its thumbs because it doesn't need to do anything. Look at the top hits that aren't somewhere in thread_block and see if you can speed up those functions or call them less often. smime.p7s
participants (1)
-
Josh Graessley