Re: are nsstrings internally locked?
Re: are nsstrings internally locked?
- Subject: Re: are nsstrings internally locked?
- From: Thomas Harrington <email@hidden>
- Date: Wed, 23 Jul 2003 21:17:55 -0600
On Tuesday, July 22, 2003, at 05:40 PM, Philip George wrote:
I'm doing a ton of nslocking on multiple threads for fear of caching a
partial nsmutablestring from one thread while another was trying to
modify it. Should I be worried about this? Are
nsstring/nsmutablestring objects locked internally? I have yet to
actually SEE with my own two eyes an NSMutableString get interrupted
by another thread while being modified with the setString: method, but
that's no proof that it couldn't happen.
Anyone know for sure?
Sure? No. But as it's not explicitly documented to be thread-safe,
the only reasonable approach is to assume it's not. Depending on the
nature of the app, it might help things to do something like have each
thread make its own copy, and then have a single thread-safe method to
somehow combine the results.
--
Tom Harrington
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.