On May 4, 2010, at 2:03 PM, Quincey Morris wrote:

1. Why are the additional instances only "considered" thread-safe. Doesn't anyone know?

I think it's using "considered" in a definite sense.

2. What does "thread-safe" mean in this context? I would take it to mean that *any* single instance allocated with [[NSFileManager alloc] init] can be used by *any* thread. Or does it mean that each thread needs a unique instance, but such instances happily co-exist?

The latter, I think. What happened was that in 10.5 the NSFileManager was extended to have a delegate, instead of being stateless. There are obvious problems with multiple clients trying to set their own delegates on the same object, or with a call on a background thread invoking a delegate call to unrelated code that wasn't expecting to be called on that thread.

3. If any single instance allocated with [[NSFileManager alloc] init] is thread-safe in the fullest sense, why doesn't [NSFileManager defaultManger] just return one of these, so that it can be (considered) thread-safe too?

Because then you wouldn't be able to set a delegate on the shared instance and have it be used on all calls involving that instance (which is the most common case.)

—Jens_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [email protected]

Reply via email to