Threading is great for in-process concurrency and certainly the preferred method of spreading workloads over multiple cores. Whenever other programs need to be called, or an independent, heavyweight task is required, sub-processes are the way to go. With the recent rise of orchestrator-type applications (Kubernetes, Docker Swarm, Mesos, and many others), managing child processes has become a more important topic as well. In this recipe, we will communicate with and manage child processes.
Multiprocessing in Rust
How to do it...
Follow these steps to create a simple application that searches the filesystem:
- Create a new project using cargo new child-processes and open it in Visual Studio Code.
- On Windows, execute cargo run...