• 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: NSOperationQueue and for-loop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOperationQueue and for-loop


  • Subject: Re: NSOperationQueue and for-loop
  • From: Mike Abdullah <email@hidden>
  • Date: Wed, 03 Oct 2012 14:53:30 +0100

On 3 Oct 2012, at 14:17, Koen van der Drift <email@hidden> wrote:

> On Wed, Oct 3, 2012 at 9:03 AM, Koen van der Drift
> <email@hidden> wrote:
> Good point, thanks. So are there any workarounds for that? I'm sure
>> this pattern (doing lots of calculations concurrently, and store the
>> results in a common object for later), is used in other situations as
>> well.
>
> From a quick search, would this work in my situation (will try later):
>
> @synchronized(temp) {
>  [temp addObject: newObj];
> }

Yes, your options boil down to:

- some kind of lock, as in your example
- shunting the -addObject: call off onto a serial queue/thread


_______________________________________________

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

References: 
 >NSOperationQueue and for-loop (From: Koen van der Drift <email@hidden>)
 >Re: NSOperationQueue and for-loop (From: email@hidden)
 >Re: NSOperationQueue and for-loop (From: Koen van der Drift <email@hidden>)
 >Re: NSOperationQueue and for-loop (From: Koen van der Drift <email@hidden>)
 >Re: NSOperationQueue and for-loop (From: email@hidden)
 >Re: NSOperationQueue and for-loop (From: Koen van der Drift <email@hidden>)
 >Re: NSOperationQueue and for-loop (From: Koen van der Drift <email@hidden>)
 >Re: NSOperationQueue and for-loop (From: Mike Abdullah <email@hidden>)
 >Re: NSOperationQueue and for-loop (From: Koen van der Drift <email@hidden>)
 >Re: NSOperationQueue and for-loop (From: Koen van der Drift <email@hidden>)

  • Prev by Date: Re: NSOperationQueue and for-loop
  • Next by Date: Suggestions for handling old document files with file paths in a sandbox environment
  • Previous by thread: Re: NSOperationQueue and for-loop
  • Next by thread: Safety of re-entering -[NSWindow makeFirstResponder:]?
  • Index(es):
    • Date
    • Thread