On 3 Oct 2012, at 14:17, Koen van der Drift <koenvanderdr...@gmail.com> wrote:

> On Wed, Oct 3, 2012 at 9:03 AM, Koen van der Drift
> <koenvanderdr...@gmail.com> 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to