Some problems can be solved by creating several processes to work on different parts of the process. In parallel processing , these processes are executed at the same time, by different CPU's. Distributed processing is a kind of parallel processing where the processes are actually executed on different computers, connected by a network . Parallel processing requires the ability to create and destroy processes, and to allow for communication among processes. One way for processes to communicate is to use shared variables .
Problems can arise if more than one process tries to use a shared variable at the same time.
Even when a program is going to be run on a regular, non-multiprocessing computer, it is often natural to break down a problem into multiple processes. These processes can then be run on a single-CPU computer using timesharing . The xTurtle programming language has some support for a simple form of multiprocessing. The fork command is used to create multiple processes, and the grab command is used to gain exclusive access to shared variables. We can also consider computers that communicate over a network.