I told you what happens... A call to similar is made and the shared array 
is then copied into that array.

If you walk the call stack to x[:] you end up 
herehttps://github.com/JuliaLang/julia/blob/b9dc4c9b96f734f09b7c693e7c23e8724267401b/base/multidimensional.jl#L188
 
where a destination array is made using similar.

This function is then called: 
https://github.com/JuliaLang/julia/blob/b9dc4c9b96f734f09b7c693e7c23e8724267401b/base/multidimensional.jl#L202
 
which copies the values in the shared array to the destination array.




On Monday, January 11, 2016 at 2:31:17 PM UTC+1, Nils Gudat wrote:
>
> I actually remember this changing around v0.3.8(?), as I had a few 
> similar(SharedArray(..)) calls in a buried in a larger model and spend some 
> time trying to figure out why the results suddenly made no sense at all...
>
> But I think my original question still stands: what does the [:] call 
> actually do on a SharedArray? Does it create a copy? Will this change in 
> 0.5 with general changes into copy/view behaviour? (Maybe the underlying 
> problem is that I don't really understand the mechanics of [:] regardless 
> of whether an array is shared or not...)
>

Reply via email to