Skip to content
| Attribute | Multiprocess | Multithreading |
|---|
| Development | Can be easier. Use of fork(2) or clone(2). | Use of threads API (pthreads). |
| Memory overhead | Separate address space per process consumes some memory resources (reduced to some degree by page- level copy-on-write). | Small. Requires only extra stack and register space, and space for thread-local data. |
| CPU overhead | Cost of fork(2)/clone(2)/exit(2), which includes MMU work to manage address spaces. | Small. API calls. |
| Communication | Via IPC. This incurs CPU cost including context switching for moving data between address spaces, unless shared memory regions are used. | Fastest. Direct access to shared memory. Integrity via synchronization primitives (e.g., mutex locks). |
| Crash resilience | High, processes are independent. | Low, any bug can crash the entire application. |
| Memory Usage | While some memory may be duplicated, separate processes can exit(2) and return all memory back to the system. | Via system allocator. This may incur some CPU contention from multiple threads, and fragmentation before memory is reused. |