Process Management - Operating Systems
source:gfg |
Topics we study on Process Management and the possible questions from each topic.
💡I will try to explain it in simple language with examples.
1) Introduction to Process
Process Vs Program
Multiprogramming
Multiprogramming
-----------------------------------------------------------------------------------------------------------------------------
🤭You have a perk here. No need to memorize anything here, in a few minutes you will understand by yourself.
Being a CS student, you probably know what programs are. The TurboC++ you used in your lab, the google chrome you are using to view this everything falls under programs.
So, what is a Process ? Process are all those tiny instances that makes a program. Still confused ?
Are you on your PC ? Press Ctrl + Shift +Esc at the same time, you see a window write ? You can see the process being executed. You might have just opened a google chrome, but see how much "process" your pc is running at the background ?
2) Process Model
Control Block/Process Table
-----------------------------------------------------------------------------------------------------------------------------
👨🏫Sometimes your professor might ask you to draw a Process Control Block Diagram, simple draw this:
Process-Id
|
Process State
|
Process Priority
|
Accounting Information
|
Program Counter
|
CPU Register
|
PCB Pointers
|
........
|
3) Thread
Definition, Thread Vs Process
Sleeping Barber
Dining Philosopher
(First Come First Served,Shortest Job First, Shortest Remaining Time Next),
Interactive System Scheduling (Round -Robin Scheduling, Priority Scheduling, Multiple Queues)
User and Kernel Space Threads
-----------------------------------------------------------------------------------------------------------------------------
📌Important:
So you know about the Process right ?Tiny instances of Program running at your PC.
Remember the difference between that Process with the Thread, once you compare and study you will understand thread better:
Remember the difference between that Process with the Thread, once you compare and study you will understand thread better:
😛If you are using mobile you might not see differences clearly, I suggest you to open in Desktop Site.
Comparison Basis | Process | Thread |
---|---|---|
Definition | A process is a program under execution i.e an active program. | A thread is a lightweight process that can be managed independently by a scheduler. |
Context switching time | Processes require more time for context switching as they are more heavy. | Threads require less time for context switching as they are lighter than processes. |
Memory Sharing | Processes are totally independent and don’t share memory. | A thread may share some memory with its peer threads. |
Communication | Communication between processes requires more time than between threads. | Communication between threads requires less time than between processes . |
Blocked | If a process gets blocked, remaining processes can continue execution. | If a user level thread gets blocked, all of its peer threads also get blocked. |
Resource Consumption | Processes require more resources than threads. | Threads generally need less resources than processes. |
4) Inter Process Communication
Race Condition and Critical Condition
-----------------------------------------------------------------------------------------------------------------------------
💀Race Condition and Critical Conditions might be nightmare if you try to read it from the notes. Just understand the concept I will link you the best YouTube video: 5) Mutual Exclusion
Mutual Exclusion with Busy Waiting (Disabling Interrupts, Lock Variables, Strict Alteration,Peterson’s Solution, Test and Set Lock)
Sleep and Wakeup,
Semaphore, Monitors,
Message Passing
Sleep and Wakeup,
Semaphore, Monitors,
Message Passing
-----------------------------------------------------------------------------------------------------------------------------
📌Monitors:
Remember to write this Syntax in Exam:
📌Message Passing
Remember to write this Syntax in Exam:
6) IPC Problems
Producer Consumer,Sleeping Barber
Dining Philosopher
7) Process Scheduling
Batch System Scheduling(First Come First Served,Shortest Job First, Shortest Remaining Time Next),
Interactive System Scheduling (Round -Robin Scheduling, Priority Scheduling, Multiple Queues)
Post a Comment