On Jul 16, 2011, at 9:54 AM, Fritz Anderson wrote:

> Your main thread is hung on a semaphore in a window-resize view animation. 
> Some other thread must be holding the semaphore. 

Tip: You can use the pop-up above the stack trace to switch between threads. 
Look at them and see if you’ve got app code in the backtrace in any of them.

Alternatively, I find the ‘sample’ tool (or the Sample command in Activity 
Monitor) very useful in looking at hung apps, since it dumps every thread’s 
stack at once. Or from the gdb prompt in Xcode you can type “thread apply all 
bt”.

> Here is the first place I'd look: AppKit (and therefore essentially all of 
> your human-interface tasks) is not thread-safe. Have you set up any threads? 
> Are you doing any drawing, window operations, etc., from a background thread?


Yup. Be very, very, very careful about making any AppKit calls from background 
threads. It’s nearly always better to delegate UI activity to the main thread, 
and there are a wealth of tools for letting your background threads message 
back to the main thread when they’ve completed work or need to display 
something.

—Jens_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to