JuliaLang / JuliaLang/Distributed.jl
Closures are availble automatically on parrellel workers, but normal functions are not
Open
@amitmurthy is already working on this.
Since Oct 12, 2016.
- Dominant language
- Julia
- Stars
- 55
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
On Julia 0.5, I encountered the following strange behavior.
addprocs(4)
function adder_gen(n)
function add(x)
x+n
end
end
f_closure=adder_gen(5)
fetch(@spawn f_closure(5))
Normally, I would expect the last line not to work. There was no @everywhere preceding the closure generation. If the this was done with a normal function, an error would be generated.
I believe an explanation is in order. There is nothing in the manual that would suggest this behavior.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.