parallel computations on Reference Classes

前端 未结 1 1314
醉话见心
醉话见心 2021-01-18 13:05

I have a list of fairly large objects that I want to apply a complicated function to in parallel, but my current method uses too much memory. I thought Reference Classes mi

相关标签:
1条回答
  • 2021-01-18 13:30

    I think the forked processes, while they have access to all the variables in the workspace, must not be able to change them. This works, but I don't know yet if it improves the memory issues or not.

    foo <- mclapply(foo, function(x) {x$reset(); x})
    foo[[4]]$balance
    ## 0
    
    0 讨论(0)
提交回复
热议问题