Usually when doing calculations on SharedArrays, I would extract their
contents using sdata() to be able to pass them to functions only defined
for regular arrays, and then write the return value back into the
SharedArray. However, I just realized that instead of doing say:
shared[:] = func(sdata(shared))
I could also do:
shared[:] = func(shared[:])
as typeof(shared[:]) is Array{Float64,1}. What is happening here? Does [:]
call sdata()?
This behaviour is sort of intuitive I guess, given that one would expect a
call to, say, shared[1] to return a Float64 rather than a SharedFloat64
(which doesn't exist), but I still don't quite get it.