Re: NSUserDefaults & thread safety
Re: NSUserDefaults & thread safety
- Subject: Re: NSUserDefaults & thread safety
- From: "Adam R. Maxwell" <email@hidden>
- Date: Wed, 25 Jan 2006 07:54:24 -0800
On Jan 25, 2006, at 04:22, Derrick Bass wrote:
On Jan 25, 2006, at 5:47 AM, Jonathan del Strother wrote:
According to the documentation, NSUserDefaults isn't thread safe.
Does this mean that any access to NSUserDefaults outside of the
main thread is a really bad idea, or am I safe to restrict write-
access to the main thread and let any thread have read-access?
See this message: <http://www.cocoabuilder.com/archive/message/cocoa/
2005/8/11/144082>, which indicates that you can probably ignore the
caution-badged warning in the NSUserDefaults API documentation.
In general "not thread safe" means that it is okay to use from
different threads, as long as you make to sure to use some sort of
synchronization so only one thread at a time is accessing the
resource.
I'd say that this generalization could cause you a lot of grief.
Adam
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden