Re: Newbie query re multithreading
Re: Newbie query re multithreading
- Subject: Re: Newbie query re multithreading
- From: Greg Parker <email@hidden>
- Date: Tue, 18 Aug 2009 17:54:21 -0700
On Aug 18, 2009, at 7:25 AM, McLaughlin, Michael P. wrote:
1) With 1 CPU (NSOperation not used), I get 50% of CPU-time devoted to
auto_collection_thread which I presume means Garbage Collection. Is
this
normal? It seems excessive.
2) With 2 CPUs, I get 26% of CPU-time for auto_collection_thread and
another
26% for mach_msg_trap --> CFRunLoopSpecific (apparently back to Carbon
again).
You may be reading the sampling results incorrectly. That 50% in
auto_collection_thread and 26% in CFRunLoopRunSpecific are almost
certainly time that those threads are waiting for something else to
happen. The garbage collector is waiting for memory usage to go too
high, and CFRunLoopRunSpecific is waiting for a user event or timer or
I/O to arrive. These are normal - the GC thread and event loop spend
most of their wall-clock time doing nothing in most programs.
The sampling tools grab stack traces every n milliseconds. A thread
that is stopped waiting for something else to happen will show up in
lots of those stack traces even though it's not using any CPU time. If
the samples always hit in exactly the same place, it's likely that the
thread is in fact doing nothing.
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden