• 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
Thread safety, some basic questions about accessing mutable objects across threads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Thread safety, some basic questions about accessing mutable objects across threads


  • Subject: Thread safety, some basic questions about accessing mutable objects across threads
  • From: Nick Rogers <email@hidden>
  • Date: Tue, 06 Aug 2013 21:09:21 +0530

Hi,

Please look at the following situations:

1. Created a mutable array in main thread, can I read its values in a secondary thread safely, while no other thread is modifying this mutable array?

2. I need to add objects to this mutable array from a secondary thread, and no other thread is modifying it. Can I simply add an object like, [array addObject:obj]; or if this is wrong how to achieve the same? The object to add is mostly NSString or NSNumber or a mutable dictionary of NSString and NSNumber.

Please help.

Best,
Nick


_______________________________________________

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


  • Follow-Ups:
    • Re: Thread safety, some basic questions about accessing mutable objects across threads
      • From: David Duncan <email@hidden>
    • Re: Thread safety, some basic questions about accessing mutable objects across threads
      • From: Jens Alfke <email@hidden>
    • Re: Thread safety, some basic questions about accessing mutable objects across threads
      • From: Kyle Sluder <email@hidden>
    • Re: Thread safety, some basic questions about accessing mutable objects across threads
      • From: Abdul Sowayan <email@hidden>
  • Prev by Date: Re: Computing the height for a UITableViewHeaderFooterView
  • Next by Date: Re: Any way to delay drawing after scrolling?
  • Previous by thread: Re: Computing the height for a UITableViewHeaderFooterView
  • Next by thread: Re: Thread safety, some basic questions about accessing mutable objects across threads
  • Index(es):
    • Date
    • Thread