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 (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com