Creating processes

To start with processes, add and make available the Distributed package with add Distributed, and using Distributed.

Julia can be started as a REPL or as a separate application with a number of workers, n, available. The following command starts n processes on the local machine (this command includes the Distributed package automatically):

// code in Chapter 8\parallel.jl 
julia -p n   # starts REPL with n workers 

These workers are different processes, not threads, so they do not share memory.

To get the most out of a machine, set n equal to the number of processor cores. For example, when n is 8, you have, in fact, nine workers: one for the REPL shell itself, and eight others that are ready to do parallel tasks. Every worker ...

Get Julia 1.0 Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.