• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: My try/catch block isn't catching exceptions on 10.6
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >My try/catch block isn't catching exceptions on 10.6 (From: Mark Allan <email@hidden>)
 >Re: My try/catch block isn't catching exceptions on 10.6 (From: Dave Keck <email@hidden>)
 >Re: My try/catch block isn't catching exceptions on 10.6 (From: Mark Allan <email@hidden>)

  • Prev by Date: Re: Core Data and +[NSExpression expressionForFunction:...]
  • Next by Date: Re: My try/catch block isn't catching exceptions on 10.6
  • Previous by thread: Re: My try/catch block isn't catching exceptions on 10.6
  • Next by thread: Re: My try/catch block isn't catching exceptions on 10.6
  • Index(es):
    • Date
    • Thread