Re: Preventing beach balls
Re: Preventing beach balls
- Subject: Re: Preventing beach balls
- From: Paul Borokhov <email@hidden>
- Date: Sun, 18 Feb 2007 17:59:36 -0800
Ah, looks like I figured out what was causing crashes earlier. From http://developer.apple.com/documentation/Cocoa/Conceptual/Multithreading/index.html#//apple_ref/doc/uid/10000057i – «Failing to catch an exception in a secondary thread is the same as failing to catch an exception in your main thread: the owning process is terminated. You cannot throw an uncaught exception to a different thread for processing.» I intentionally threw exceptions in my app that would be caught by the main thread, but looks like that's not the way to do it. «If you need to notify another thread (such as the main thread) of an exceptional situation in the current thread, you should catch the exception and simply send a message to the other thread indicating what happened.»
Thanks for the pointers!
Paul
----------Original Message----------
On 2/18/07 17:52 , Paul Borokhov (email@hidden) wrote:
> Thanks, I guess I'll give this another shot. I had originally done
> the detachNewThread thing, but after some testing my app crashed and
> I figured it was because I was doing something wrong...
> So do I need to do anything special to use instance variables of the
> main thread from within methods on the detached thread? Or is this
> handled automatically by Cocoa?
> Paul
>
> ----------Original Message----------
> On 2/18/07 17:14 , Seth Willits (email@hidden) wrote:
>> Naturally if you need to communicate with other threads, you'll need
>> to do that (performSelectorOnMainThread:withObject: will probably
>> work most of the time), and if you use objects on multiple threads
>> you need to use techniques to keep them safe (Yay NSRecursive lock),
>> but it's basically that simple.
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> 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
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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