• 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: are nsstrings internally locked?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >are nsstrings internally locked? (From: Philip George <email@hidden>)

  • Prev by Date: Re: Bug reports and documentation updates
  • Next by Date: Re: Bug reports and documentation updates
  • Previous by thread: are nsstrings internally locked?
  • Next by thread: Re: are nsstrings internally locked? (nsmutablestrings actually)
  • Index(es):
    • Date
    • Thread