I have 2 machines with identical versions of R (3.4.4) and the future package (1.10.0). I am running the code below, that implements asyncronous programming
tic()
library(future)
plan(multisession)
mehAsync = function(){
future::future({
Sys.sleep(5)
return('meh')
})
}
out = mehAsync()
what = then(out,function(value){(value)})
toc()
The expected behaviour is that the execution will end almost instantly, leaving what
to be a pending promise. In one machine this happens, the execution happens instantly. However in another machine I have, the execution waits for the mehAsync
function to execute, finishing in 5 seconds.
I am unsure about how to proceed with debugging this issue and would like some advice. Both machines are on Ubuntu, both are running same versions of R and future. I am also not receiving any error/warning messages of any kind.
A key difference between the machines is that the slower one has only 1 core but I am not that low on CPU or RAM that running two R sessions at the same time causes the other to hang.