Shared Memory InterProcessCommunication.jl

Viewed 71

I would like to use Shared Memory in my applications, but I am struggling to find an example/documentation for how to use it. I am using InterProcessCommunication.jl.

I have two programs, AppWriter.jl, and AppReader.jl. AppWriter will create and write to shared memory, then I want AppReader.jl to detect the change and print the info in the array. Would I use semaphores for this?

I am also planning to use Julia to python as well, hence why I don't use sharedarrays.jl.

using InterProcessCommunication

function main()
    id = "/myid"
    len = 4096
    x = SharedMemory(id, len; perms=0o600, volatile=true)
    x[1] = 1
    print(x)
    print(x[1])
end
main()

(The id has a '/' in it to use POSIX.)

Gives this error:

LoadError: MethodError: no method matching setindex!(::SharedMemory{String}, ::Int64, ::Int64)
0 Answers
Related