Here are some pros of the MT model over the single-threaded process:
Context | Multiprocess (single-threaded) model | Multithreaded (MT) model |
Design for parallelized workloads |
|
|
Creation/ destruction performance | Much slower | Much faster than processes; resource-sharing guarantees this |
Context switching | Slow | Much faster between the threads of a process |
Data sharing | Done via IPC (Inter-Process Communication) mechanisms; involves a learning curve, can be fairly complex; synchronization (via the semaphore) required |
Inherent; all global and static data items are implicitly shared between threads of a given process; synchronization (via the mutex) is required |
Table 4: Multiprocess versus multithreading model – pros of the MT model