• 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: ivar access during -finalize
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ivar access during -finalize


  • Subject: Re: ivar access during -finalize
  • From: Quincey Morris <email@hidden>
  • Date: Thu, 08 Mar 2012 13:40:32 -0800

On Mar 8, 2012, at 09:09 , Nick Zitzmann wrote:

> +defaultManager is not thread-safe IIRC.

It's currently listed as thread-safe:

	https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Multithreading/ThreadSafetySummary/ThreadSafetySummary.html

I believe there was historically some confusion because the safety characteristics changed in 10.5, and the documentation didn't properly reflect the post-10.5 behavior. There were 2 separate safety issues:

1. Is NSFileManager atomically safe? That is, can you safely use a single instance from multiple threads without confusing the instance.

2. Is NSFileManager thread safe? Can you safely use multiple instances from multiple threads without (say) running into a file system deadlock.

If #2 wasn't true, you'd have to use instances other than [NSFileManager defaultManger] with extreme care. If #1 wasn't true, you'd have use a different instance in each thread, or implement your own atomic lock.

I believe #1 wasn't true pre-10.5, but it was hard to know for sure because most information on the subject didn't properly distinguish between atomicity and thread safety.


_______________________________________________

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: 
 >ivar access during -finalize (From: "email@hidden" <email@hidden>)
 >Re: ivar access during -finalize (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: Accessing array in thread safe way
  • Next by Date: Re: Accessing array in thread safe way
  • Previous by thread: Re: ivar access during -finalize
  • Next by thread: @-directives
  • Index(es):
    • Date
    • Thread