Operating Systems · Beginner · Topic 2 of 3
Processes & Threads
5 questions.
Your progress0%
- 1st Visit
- 0/5
- 2nd Visit
- 0/5
- Revise
- 0/5
Overview
A process is a program in execution, with its own memory and resources, while a thread is a lighter unit of execution that shares the memory of its process. The operating system tracks each process in a process control block and moves it between states such as ready, running and waiting, switching the CPU from one to another with a context switch. On Unix-like systems, new processes are created with fork(), given a new program with exec(), and collected by their parent with wait() when they finish. Expect questions on process versus thread, the state diagram, the cost of a context switch, fork() output puzzles, and zombie and orphan processes.
Questions
| # | Problem | Platform | Difficulty | Open | 1st1st Visit | 2nd2nd Visit | RevRevise |
|---|---|---|---|---|---|---|---|
| 1 | What is the difference between a process and a thread? | Concept | Easy | Read the answer to What is the difference between a process and a thread? | |||
| 2 | What are the states of a process, and what is a PCB? | Concept | Easy | Read the answer to What are the states of a process, and what is a PCB? | |||
| 3 | What is a context switch, and why is it considered overhead? | Concept | Medium | Read the answer to What is a context switch, and why is it considered overhead? | |||
| 4 | What does fork() do, and what does it return? | Concept | Medium | Read the answer to What does fork() do, and what does it return? | |||
| 5 | What are zombie and orphan processes? | Concept | Medium | Read the answer to What are zombie and orphan processes? |