Comparison
Processes | Threads | |
---|---|---|
Switch Overhead | High (CPU state + Memory, I/O state) | Low (CPU state only) |
Creation Cost | High | Low |
CPU Protection | Yes | Yes |
Memory, I/O Protection | Yes | No |
Sharing Overhead | High (Involves at leas a context switch) | Low (Because thread switch overhead is low; may not need to switch context) |
Sharing Security | High (One process cannot corrupt the other) | Low (A thread can write the memory used by another thread) |