Warning, horrible hack alert!
I'm sure there must be a far better implementation, but the idea is to have an
array subclass which diverts all method calls through a serial dispatch queue,
which should ensure thread safe access.
Anyway, here's the horrible hack. By the way, it manages to break En
What's the advantage of this over just iterating over the array serially using
each?
Matt
On Jan 24, 2011, at 3:40 AM, Alan Skipp wrote:
> Warning, horrible hack alert!
> I'm sure there must be a far better implementation, but the idea is to have
> an array subclass which diverts all method ca
The post was admittedly vague, but was more of an idea about a general purpose
thread safe array class (in principle, this could apply to any mutable class).
Perhaps implemented as a module that would redirect all method calls through a
serial dispatch queue. This would mean that the array (or o
My guess is that most problems need a thread-safe mechanism, where manipulating
an array is just one part of a more complex system. Pushing the details of the
thread-safety into the array just hides the problem, and will likely trade more
locking for possibly simpler code.
Which could be a ver
eds to be updated. Anyone know better?
>>>
>>> -- Ernie P.
>>>
>>>
>>>>
>>>> - Charlie
>>>> ___
>>>> MacRuby-devel mailing list
>>>> MacRuby-devel@lists.maco
e portion of memory, but
>>>> doing a serial append:
>>>>
>>>> result << i*i
>>>>
>>>> would not. But that may have been a mistake on my part, since the size
>>>> (at least) needs to be updated. Anyone know better?
Hi all,
On Jan 24, 2011, at 8:24 AM, Matt Massicotte wrote:
> I'm just saying that achieving parallelism actually is hard. I've been much
> better served (though, admittedly, not in Ruby) by trying to get really
> familiar with the queue paradigm and understanding how to use them in place
> o
Hey Charles,
Sure, this is as good a place as any to report issues on ControlTower.
There's also a component for ControlTower on the MacRuby trac site, but I
guess we don't really call that out on the web site.
Regarding the potential bug...well...where to begin? So, yes, MacRuby blocks
have the
On Mon, Jan 24, 2011 at 10:24 AM, Matt Massicotte wrote:
> My guess is that most problems need a thread-safe mechanism, where
> manipulating an array is just one part of a more complex system. Pushing the
> details of the thread-safety into the array just hides the problem, and will
> likely t
On Sat, Jan 22, 2011 at 12:57 AM, Charles Oliver Nutter wrote:
> I'm curious about this example in Queue#apply's rdoc:
>
> * gcdq = Dispatch::Queue.new('doc')
> * @result = []
> * gcdq.apply(5) {|i| @result[i] = i*i }
> * p @result #=> [0, 1, 4, 9, 16, 25]
>
> apply is said t
On Mon, Jan 24, 2011 at 12:15 PM, Charles Oliver Nutter wrote:
> Queue#apply is actually defined in gcd.c in MacRuby's code, so this
> would be a MacRuby bug. I'd have filed it, but I wasn't sure if I was
> missing something about MacRuby's Array and thread-safety.
Yeah, probably a documentatio
On Jan 24, 2011, at 8:00 AM, Alan Skipp wrote:
> The post was admittedly vague, but was more of an idea about a general
> purpose thread safe array class (in principle, this could apply to any
> mutable class). Perhaps implemented as a module that would redirect all
> method calls through a se
On Mon, Jan 24, 2011 at 11:26 AM, Joshua Ballanco wrote:
> On Mon, Jan 24, 2011 at 12:15 PM, Charles Oliver Nutter
> wrote:
>>
>> Queue#apply is actually defined in gcd.c in MacRuby's code, so this
>> would be a MacRuby bug. I'd have filed it, but I wasn't sure if I was
>> missing something about
On Mon, Jan 24, 2011 at 11:39 AM, Jordan K. Hubbard wrote:
> FWIW, we've tried this same approach experimentally (use a per-object serial
> queue behind the scenes to implement an async setter / sync getter model)
> over in CoreFoundation land, and it seemed to work reasonably well for the
> mo
On Mon, Jan 24, 2011 at 11:23 AM, Joshua Ballanco wrote:
> Arrays in MacRuby are not inherently thread safe. However,
> "Dispatch::Queue.new" creates a serial queue. So, there is an error in that
> each invocation of the block will execute serially. If, instead, the example
> had used "Dispatch::Q
Hi MacRubyists:
MacDriverLog is an application I am developing for truckers using MacRuby.
I can't fully test the installer without a second machine. I would appreciate
it if someone could download it from http://MacDriverLog.com and let me know if
the install package works.
Thanks,
Bob Rice
On Mon, Jan 24, 2011 at 8:20 PM, Charles Oliver Nutter
wrote:
> Yes, forcing the updates to run serially rather than in parallel. The
> poor-man's fork/join.
More like a map-reduce, I would think. In fact, at some point in the past
the "dispatch extras" (i.e. everything in MacRuby dispatch relat
17 matches
Mail list logo