Hello!
I have a simple module file (MyMod.jl), say:
module MyMod
using Distributed
using Base.Threads
function func()
println("calling func()")
r = @spawn sqrt(4)
fetch(r)
end
end # MyMod
Now I do the following in REPL (or include(“mymain.jl”))
using Distributed
using Base.Threads
@everywhere push!(LOAD_PATH, @__DIR__)
@everywhere using MyMod: func
func()
It succeeds at first time. However after any changes in func() and call func(), the code fails to run throwing some error message unless I restart Julia:
call func() 2
ERROR: On worker 3:
UndefVarError: ##5#6 not defined
deserialize_datatype at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.2\Serialization\src\Serialization.jl:1186
handle_deserialize at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.2\Serialization\src\Serialization.jl:775
Could anyone help me with this?