Login  Register

Re: Arrays and thread safety

Posted by Michael Doube on May 07, 2009; 9:51pm
URL: http://imagej.273.s1.nabble.com/Arrays-and-thread-safety-tp3692620p3692625.html

Albert Cardona wrote:

> Thomas Boudier wrote:
>> Hi Michael,
>>
>> I mean when each thread work on separate arrays, I split my images in
>> 4 parts (when I have 4 cpus) with overlap and process each part with a
>> thread and then recombine them.
>>
>> Thomas
>
>
>
> I second that, makes big difference.
> It's all about resource contention when accessing/modifying variables:
> the best is to have none at all.
>
> Albert

So is it enough for each thread to have access to separate arrays within
a 2D array (e.g. different values of z for workArray[z][])?  Or does
each thread need its own copy of the elements as a completely separate
entity?

Mike