So isready() seems to block if the process the RemoteRef is on is busy.
On the REPL
addprocs(1)
@everywhere function test()
i = 0
while true
i += 1
end
return i
end
rref = @spawn test()
isready(rref) # <- blocking
What I would have expected is that it is evaluating to false (maybe after a
timeout). Adding a yield() to the while loop allows the call to go through
and properly evaluate to false.
The reason I stumbled across the was my task management code contains the
following snippet.
...
timedwait(() -> anyready(working_on), 120.0, pollint=0.5)
...
function anyready(working_on)
for rref in values(working_on)
if isready(rref)
return true
end
end
return isempty(working_on)
end
But even adding the occasional yield to the computation job creates a
situation when it sometimes get stuck and sometimes it doesn't.
Best Valentin