OS Module 1 Study Material
OS Module 1 Study Material
3. Processes
3.1 Process Concept
A process is a program in execution. It includes the program code, data, and state (like what's
currently happening in the program).
3.2 Process Scheduling
The OS decides which process runs and when using a scheduler. Common types:
• FCFS (First Come First Serve)
• SJF (Shortest Job First)
• Round Robin
• Priority Scheduling
3.3 Operations on Processes
Processes can:
• Be created (forked)
• Run
• Wait
• Be terminated
The OS manages all these transitions.
3.4 Interprocess Communication (IPC)
Processes often need to communicate. IPC allows data to be exchanged between processes using:
• Shared memory
• Message passing
3.5 Communication in Client–Server Systems
In a client-server model:
• The client sends a request.
• The server processes it and responds.
This is common in web browsing, email, etc. IPC is used here too, over network sockets.
4. Threads
4.1 Overview
A thread is a smaller unit of a process. A single process can have multiple threads that run parts of
the program simultaneously. They share memory but run independently.
4.2 Multithreading Models
• Many-to-One: Many user threads mapped to one kernel thread.
• One-to-One: One user thread per kernel thread.
• Many-to-Many: Many user threads mapped to a smaller or equal number of kernel threads.
4.3 Threading Issues
Multithreading brings challenges:
• Synchronization: Threads need to be coordinated to avoid data conflicts.
• Deadlock: Threads waiting forever for each other’s resources.
• Scalability: System should efficiently manage many threads.