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.



play-rounded-fill play-rounded-outline play-sharp-fill play-sharp-outline
pause-sharp-outline pause-sharp-fill pause-rounded-outline pause-rounded-fill
00:00

Here’s a complete explanation of:


Contents [hide]

🎓 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 (हिंदी में समझें)

csharp
[Running Process A]
|
| (Interrupt / I/O / Scheduler decision)

[Save A's context in PCB_A]

[Load B's context from PCB_B]

[Running Process B]

🧠 Context Switching कब होता है?

  1. Interrupt आने पर

  2. System Call (जैसे I/O request)

  3. Multitasking (Time Sharing OS में)

  4. 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!

Day 01Part 15 – Operating system for gate in Hindi – Context Switching in Operating system.

HORTICULTURE DEVELOPMENT

5R_TV `W UVReY UVdecfTeZ`_ Z_ 3V_XR]fcf



Leave a Reply

Your email address will not be published. Required fields are marked *

error: