> On 23 Mar 2015, at 12:47 pm, Graham Cox <graham....@bigpond.com> wrote:
> 
> But what actual form would a task take that said "loop as many times as 
> necessary until there's no more to do, then finish"? 


Just to clarify, as re-reading this it isn't clear what I really mean:

I mean a task that will loop on each turn of the run loop until done, then 
finish. Seems to me there isn't really anything that quite fits that - an 
NSOperation fires once, so I'd need to keep creating these and rescheduling 
them. Maybe that's OK, performance wise? Alternatively a timer can be made to 
fire once per run loop, but never stops. Maybe a thread with a lock really is 
the best approach here, especially as it punts the simulation on to a second 
processor so it can run as fast as possible as long as it needs to. The hassle 
there is messaging the main thread for UI updates and all the usual 
multi-threaded gotchas.

I've had lots of helpful suggestions (thanks!), but the best way forward is 
still not that obvious.

--Graham



_______________________________________________

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