Re: My try/catch block isn't catching exceptions on 10.6
Re: My try/catch block isn't catching exceptions on 10.6
- Subject: Re: My try/catch block isn't catching exceptions on 10.6
- From: Andrew Farmer <email@hidden>
- Date: Fri, 27 Nov 2009 12:39:10 -0800
On 27 Nov 2009, at 11:40, Mark Allan wrote:
> Isn't it the case that you only need locks around something if you plan that it will be modified by more than one thread at a time, or if you write to it in another thread and care that any read operation will be predictable?
No, that is not the case. An object that is described as "not thread-safe" may enter an inconsistent state while being modified that will cause a crash or data corruption if accessed. Moreover, there is no guarantee that accessor methods will not modify internal state of an object (to cache results, for instance, or to control access to another object).
Short version - if an object is not described as being thread-safe, never try to do *anything* with it from multiple threads at a time. Otherwise, you're just asking for trouble._______________________________________________
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