Re: [MacRuby-devel] thread-safety and collections in macruby

2011-10-21 Thread Michael Johnston
Thanks. Since there are a lot of options I'm going to do a benchmark to compare them. For my particular workload, the problem is a "changing gears" sort of problem, where I need to collect an aggregate result to the ui. Since the worker loop is pretty consistent in the time each iteration takes

[MacRuby-devel] locals & dispatch: is using a pointer the best practice?

2011-10-21 Thread Michael Johnston
When I need to get a queue-protected result into a local in code that is concurrent (so I can't use an ivar) is a pointer the best (only) way to get the result of a sync block? Assuming I don't want to factor out a method object. ex: result_p = Pointer.new(:id) some_queue.sync do resu

Re: [MacRuby-devel] thread-safety and collections in macruby

2011-10-21 Thread Michael Johnston
Thanks, I am using: results = NSArray.arrayWithArray(worker_results) which although it reports true for is_a?(NSMutableArray) is immutable. Cheerio, Michael Johnston lastobe...@mac.com On 2011-10-20, at 3:47 PM, terl wrote: > Just a note to the original question > > macruby collection