Day 01Part 15 – Operating system for gate in Hindi – Context Switching in Operating system.
Day 01Part 15 – Operating system for gate in Hindi – Context Switching in Operating system.
Here’s a complete explanation of:
Contents [hide]
- 1
Day 01 – Part 15: Context Switching in Operating System (in Hindi for GATE CSE)
- 1.1
Context Switching क्या होता है?
- 1.2
Context Switching में क्या-क्या save होता है?
- 1.3
Context Switching Diagram (हिंदी में समझें)
- 1.4
Context Switching कब होता है?
- 1.5
Context Switch Time क्या होता है?
- 1.6
Context Switch के फायदे और नुकसान:
- 1.7
GATE-Level MCQ Example:
- 1.8
Short Notes for Revision (One-liners):
- 1.9
Extra Tip:
- 1.1
Day 01 – Part 15: Context Switching in Operating System (in Hindi for GATE CSE)
Topic: Context Switching
Language: Hindi + Key English Terms (for GATE preparation)
Context Switching क्या होता है?
Context Switching एक ऐसा process है जिसमें CPU एक process से दूसरे process पर switch करता है। जब भी CPU एक process को रोककर दूसरे को execute करता है, तो उसे पहले process का context (status) save करना होता है, ताकि बाद में वहीं से शुरू किया जा सके।
Context Switching में क्या-क्या save होता है?
जब context switch होता है, तो OS को process के ये details save करने होते हैं:
-
Program Counter (PC) ➝ अगला instruction कहाँ से शुरू होगा
-
CPU Registers (R1, R2…)
-
Process State (Running, Ready, Waiting)
-
Stack Pointer
-
Memory Management Information
ये सारी information PCB (Process Control Block) में store होती है।
Context Switching Diagram (हिंदी में समझें)
Context Switching कब होता है?
-
Interrupt आने पर
-
System Call (जैसे I/O request)
-
Multitasking (Time Sharing OS में)
-
Preemption (Higher priority process के आने पर)
Context Switch Time क्या होता है?
Context switch time वह time है जिसमें एक process को रोककर दूसरा शुरू किया जाता है। इस समय कोई भी actual work (processing) नहीं होता — सिर्फ switching overhead होता है।
GATE में यह पूछा जा सकता है कि:
“Is context switch time productive?”
Answer:No, it is an overhead.
Context Switch के फायदे और नुकसान:
फायदे:
-
Multitasking संभव बनती है
-
CPU utilization बढ़ता है
-
Real-time responses मिलते हैं
नुकसान:
-
Overhead time बढ़ता है
-
Cache memory invalidate होती है
-
System slow हो सकता है अगर frequent switches हों
GATE-Level MCQ Example:
Q: Context switch involves:
A) Switching from kernel to user mode
B) Saving and restoring process states
C) I/O management
D) Memory allocation
Short Notes for Revision (One-liners):
-
Context Switch ➝ Process change
-
PCB ➝ Holds context info
-
Overhead ➝ No real work done
-
Needed in ➝ Preemptive multitasking
-
Time-saving?
No, costly
Extra Tip:
In GATE, context switching is often paired with:
-
Scheduling algorithms
-
Process states diagram
-
Multitasking OS behavior
Would you like:
-
Hindi video script for this topic?
-
Handwritten notes PDF?
-
Animated diagram of context switch process?
Let me know!