【发布时间】:2018-07-09 19:54:42
【问题描述】:
我试图在函数超时时终止它的执行。试图利用这里的帖子:Julia: Can you set a time limit on eval
RemoteRef 上的错误未定义(我使用的是 v0.6.0)。将 RemoteRef 替换为 Channel(1)。现在错误是
MethodError: 没有匹配 remotecall_fetch 的方法 (::Int64, ::#test, ::String, ::String, ::String)
addprocs(1)
@everywhere include("test.jl")
response = Channel(1)
@async put!(response, remotecall_fetch(2, test, arg1, arg2, arg3))
start=time()
while !isready(response) && (time() - start) < timeoutDuration
sleep(0.1)
end
elapsedtime = time()-start
ERROR(未处理的任务失败):MethodError: no method matching remotecall_fetch(::Int64, ::#test, ::字符串, ::字符串, ::字符串)
也试过了
@async put!(response, remotecall_fetch(2, ()->test(arg1, arg2, arg3)))
ERROR(未处理的任务失败):MethodError: no method matching remotecall_fetch(::Int64, ::##10#12)
第二个工人找不到 test() 吗?
【问题讨论】:
标签: asynchronous parallel-processing timeout julia