Modify a remote object

worker 2.

Maybe something like:


@everywhere begin
    defineA(src) = global const A = src
    incrementA() = (A .+= 1)
    getA() = A

Test it out:

p = 2
B = zeros(Int,2,2)
remotecall_fetch(defineA, p, B)
remotecall_fetch(getA, p)
remotecall_fetch(incrementA, p)
remotecall_fetch(getA, p)

You might also want to look at: How to avoid repeated data movement between processes?

See also ParallelDataTransfer, which provides helper functions for transferring data between worker processes.