Process
- Tags
- comp-arch
Is an instance of computer program that may be running.
Each process is allocated its own area of memory, where it can keep variables, results and even program instructions. Once the process finishes it responds with an exit status (a number in the range \( [0, 256) \)).
Memory Layout
When a process starts it gets its own address space including, in order, a:
Advantages Over Threads
Creating a separate process is more useful when:
- When more security is desired (example the Chrome browser uses different processes for different tabs).
- When you are running into synchronisation primitives and each process is operating on something in the system.
- When you have too many threads the kernel tried to schedule all the threads near each other which could cause more harm than good.
- When you don't want to worry about race conditions.
- If one thread blocks in a task (Example: IO) then all threads block. Processes don't have this restriction.
- When the amount of communication is minimal enough that simple inter-process communication needs to be used.