Can Shared Arrays handle simultaneous recording in Julia?

So, I tried to optimize the array operation in Julia, but noticed that sometimes I get a rather big error on my matrix. I also noticed that it was possible to write the same SharedArray index in Julia at the same time. I was wondering if Julia could handle this. If not, how can I handle this?

Here is a basic example of my problem

for a list of arbitrary x,y indexes in array J j[x,y] += some_value end 

Can Julia handle this case or, like C, will there be a possibility of overwriting data. Are their atomic operations in Julia a compensation for this?

+6
source share
1 answer

Shared arrays intentionally do not have locking, as locking can be expensive. The easiest approach is to schedule non-overlapping jobs for different processes. However, you can find someone wrote the lock library, or by itself: https://en.wikipedia.org/wiki/Mutual_exclusion

+4
source

All Articles