If you never call yield(), you never give the task an opportunity to see
updates. (Sleep calls yield)

On Thursday, July 24, 2014, Sebastian Vollmer <[email protected]> wrote:

> Additional Remark
> Removing the sleep(0.1) in the
> dowork()
> function results in an infinite loop. Why is that and what can be done?
>
> @everywhere function dowork(res,nZs)
>
>     global toStop
>
>     global steps
>
>     while !toStop
>
>         for j=1:steps
>
>             localpart(res)[1]+=rand()
>
>             localpart(nZs)[1]+=1
>
>         end
>
>         #sleep(0.1);
>
>     end
>
> end
>
>
>

Reply via email to