- 2072 Asoj · 2+2 marks
Process vs thread; multithreading advantages
Short answer
A process is a heavyweight entity with its own address space, while a thread is a lightweight unit sharing the process's resources. Multithreading improves responsiveness, resource sharing, economy, multiprocessor utilization, and simplifies concurrent programming.
a) Differentiate between process and thread. Explain the advantages of multithreading.
Process vs thread
A process is a program in execution with its own address space and resources. A thread is a lightweight unit of execution within a process; threads of one process share its code, data and open files but have their own program counter, registers and stack.
| Basis | Process | Thread |
|---|---|---|
| Weight | Heavyweight | Lightweight |
| Address space | Separate for each process | Shared by threads of the same process |
| Creation / switching | Slow, costly | Fast, cheap |
| Communication | Needs IPC (pipes, messages) | Directly through shared memory |
| Protection | Isolated from other processes | No protection between threads |
| Failure | One process crash does not affect others | A faulty thread can kill the whole process |
Advantages of multithreading
- Responsiveness: the program continues (e.g. UI) while one thread is blocked or doing a long task.
- Resource sharing: threads share memory and files, so no special IPC is needed.
- Economy: creating and switching threads costs much less than processes.
- Better use of multiprocessors: threads run in parallel on different CPUs (scalability).
- Simpler program structure for concurrent tasks such as a web server serving many clients.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- What is process; process vs thread · Operating System, chapter 2
- Process vs thread; context switching · Operating System, chapter 2
- Process vs thread; user and kernel threads · Operating System, chapter 2
- Preemptive vs non-preemptive; process states · Operating System, chapter 2
- Process vs thread and task states · Embedded System, chapter 6
- Thread, multithreading and necessity · Embedded System, chapter 6
- Process versus thread differences · Embedded System, chapter 6 · asked 4×
- Instruction, thread, process level parallelism · Microprocessor, chapter 6