Distributed operations on shared arrays