OS
OS
1. Definition of Process
2. Process Relationship
State Description
The PCB is a data structure used by the operating system to store all
information about a process.
Contents of PCB:
6. Context Switching
● Definition: The process of storing the state of a currently running process and loading the state of the
next ready process.
● Occurs when the CPU switches from one process to another.
● The OS saves the context (CPU state) of the current process in its PCB and loads the context of the
next process.
Note: Context switching introduces overhead, as no useful work is done during the switch.
Threads
1. Definition of Thread
3. Benefits of Threads
● Responsiveness: Multithreaded programs can remain responsive even if part of the program is
blocked.
● Resource Sharing: Threads within a process share resources, reducing overhead.
● Economy: More efficient to create and switch threads than processes.
● Scalability: Can take advantage of multiprocessor architectures.
4. Types of Threads
5. Concept of Multithreading
● Multithreading refers to the ability of a CPU (or single core) to manage multiple threads of execution
within a single process.
● Single-core CPU: Multithreading is time-sliced.
● Multi-core CPU: Threads can run in parallel.
Advantages of Multithreading: