When a process is running and being interrupted by another higher-priority process, the context of the current running process is saved into its PCB. The task of saving the state of the current running process and restore the state of another process is called context switching. Context switching time is an overhead, because the system does nothing usefull while switching (no process in execution) Context switching time varies from machine to machine. It depends on the memory speed. Typical speed is about few ms.
So, context switching is: when a process is being run by the processor, another process of higher priority called interrupt interrupts the process. In this case the state of prucess being interrupted is saved and CPU is assigned to processor. Once that interrupted is handled and executed, the preciously running process that was suspended is again resmed by the processor. This is called context switching.
Or the process time quantum is finished Or it goes for I/O Or it terminates due to error or just completes the instruction Then also context switch happens
I have exam tomorrow and sir your explanation made me learn OS easily.i thought these all are tough but it much easier after listening you.thank u so much sir🙂
Since the last video was on process scheduling, I decided to schedule the process of watching this video next. When I clicked on it, however, I noticed that I went through a context switch by going from one task to another.
I am very thankful to u man u done a great job every single word you said is understandable so again a big thnku from my side i wish u will get all the happiness u want
But this context switching happens per Processing Unit, right? when you say that the processor is not doing anything while switching you mean the specific processing unit (in case there is multithreading), right?
I have a doubt. So, a few lectures back (in System Call Lecture) we learnt that the switching done by a process to switch from User mode to Kernel mode or kernel mode to User mode is known as context switching. And in this lecture we learnt that when a running process is interrupted by a higher priority process then, the state of process being interrupted is saved. Once that interruption is handled, the preciously running process is again resumed. This is called context switching. How the two context switching different? Or are these same?
Yeah you were right guys I just checked that video and foud a top liked comment which seems everone agree with, The comment says that "switching from kernel to user and vice versa is known as mode shifting not context switch. Context switch is the one which happens between 2 processes " .
State saving here implies saving the state of previously executing process in PCB so that when the cpu come after completing the execution of the interrupting process it continue the execution of the process from the point where it resumes. While state restore referes to restoring the state of the new interrupting task so that cpu starts its execution. Hope it helps!
But in one of the previous video he said context switching is about changing from user mode to kernel mode and vice versa......in this video he contradicted it...i don't know someone explain please
I really liked the example related to MOTHER.
universally relatable
same here
Sad truth: Batman can never get the real meaning of the context switching.
I was about to write about it
When a process is running and being interrupted by another higher-priority process, the context of the current running process is saved into its PCB.
The task of saving the state of the current running process and restore the state of another process is called context switching.
Context switching time is an overhead, because the system does nothing usefull while switching (no process in execution)
Context switching time varies from machine to machine. It depends on the memory speed. Typical speed is about few ms.
I loved how you introduced helping the mother as a higher priority task. It really is. Thanks for the wonderful course on OS, friend. :)
😁😁😁😁
So, context switching is: when a process is being run by the processor, another process of higher priority called interrupt interrupts the process. In this case the state of prucess being interrupted is saved and CPU is assigned to processor. Once that interrupted is handled and executed, the preciously running process that was suspended is again resmed by the processor. This is called context switching.
Thanks
Or the process time quantum is finished
Or it goes for I/O
Or it terminates due to error or just completes the instruction
Then also context switch happens
Thanks!
Fantastic 🤩
Nice explaination ❤
I have exam tomorrow and sir your explanation made me learn OS easily.i thought these all are tough but it much easier after listening you.thank u so much sir🙂
just like always,you are serving a good content and examples to help students understang the things thoroughly
thanku NESO ACADEMY
perfect and I really admire your lecture, I really regret seeing this video just before the final but, this is great to know this channel!
I am so grateful for these videos, thank you forever!
Those are great metaphors that you use in your videos! Really helpful in memorizing the main aspects. Thank you for the great content!
Neso academy is the one and only channel where we can learn cmsa properly
Since the last video was on process scheduling, I decided to schedule the process of watching this video next. When I clicked on it, however, I noticed that I went through a context switch by going from one task to another.
Lol🤸😅
The example is very vivid! Bro you really did a great job. Plz keep going.
Thank you, Sir, your videos makes me love computer science.
first time got the clarity of what exactly context switching is.
Very very very much thank you @NesoAcademy. Your teaching skills are brilliant. Keep doing, it's a very good thing.
Thank you so much neso academy for neat & clean explanation about operating system concepts..
Excellent analogy for Context Switch and Nice explanation.
I am just watching 3rd video and I think I am understanding everything about context switching process scheduling
All my doubts are cleared. Thanks a lot Sir. It is really very useful. Thanku
Sir each and every word you speak has some deep meaning in it ,loving the journey of operating system with you sir
Hey bro/sis, I'm really confused with the difference between state saving and restoring, aren't them the same ?, please help me understanding it
I am very thankful to u man u done a great job every single word you said is understandable so again a big thnku from my side i wish u will get all the happiness u want
The examples you give are really awesome 🙌
The real life example you just described here.. 👏👏
Really helpful...I liked the real life example which you gave in this video..plz cover all concepts of operating system...tq..
great video, very well explained. It would be great if you can share an index that lists all the topics that will be covered in OS playlist.
Love the way Of Explanation ❤️🔥
Good explanation with suitable example... It's so simple and clear.. Thank you...
Great videos, even greater playlist. Really well done, thanks
amazing , makes it so much easier to understand..
Thank you so much sir for understanding such topics and the real life application are more helpful to understand
Great video! Tip, watch in 1.5 x speed
Thank u very much..... Ur teaching skill is very good....
After watching 20th video i have more confidence in English cause i seeing this video in 2x but sill it's Cristal clear ❤️❤️❤️❤️❤️
Amazing Class! Thank you from Brazil. Your channel is excellent guys, thank you :D
Thank you for this unambiguous explanation...It cleared my doubt
Thanks for the gift!
Thanks for everything Sir. 😇❣️
Thanks man, i have an exam on thursday and you helped me a lot. Thank you !
What an example given 🔥
LOVED YOUR CONTENT BROTHER IT HELPED ME A LOT DONT KNOW WAY HOW TO THANK YOU BUT THANK YOU BRO 😍🙏🙏🙏
always helpful especially in exam time..🥰
Nice example sir
I LOVE NESO ACADEMY.....
Thanks a lot ...really helped...much appreciated 😊
Great introduction. thanks!
Very well and concisely explained!
Really nice and easy explanation thank you ❤
great video ..plz add notes for rest of the modules too
Thanks alot sir best explanation ever💗
Best explanations ever! thanks a lot
Thank you so much dear teacher
thank you a lot, it is all perfectly clear now.
thanks for the information
Using your example the PCB is the book mark ?
Thank You Sir...
Nice way explained like it :)
Hey bro/sis, I'm really confused with the difference between state saving and restoring, aren't them the same ?, please help me understanding it
dude ur the best thank u fr
10 minutes video and you could explained it in 4 minutes oh my god
But this context switching happens per Processing Unit, right? when you say that the processor is not doing anything while switching you mean the specific processing unit (in case there is multithreading), right?
Great brother.
I have a doubt. So, a few lectures back (in System Call Lecture) we learnt that the switching done by a process to switch from User mode to Kernel mode or kernel mode to User mode is known as context switching. And in this lecture we learnt that when a running process is interrupted by a higher priority process then, the state of process being interrupted is saved. Once that interruption is handled, the preciously running process is again resumed. This is called context switching. How the two context switching different? Or are these same?
same doubt did you got the ans
@@snehagupta1044 no. I think they don't reply to old videos anymore.
@@meenalphartiyal1548 yeah may be but by surfing over the net I think the current definition is correct not the previous one
Yeah you were right guys I just checked that video and foud a top liked comment which seems everone agree with, The comment says that "switching from kernel to user and vice versa is known as mode shifting not context switch. Context switch is the one which happens between 2 processes " .
You are great! Thank you.
Grazie millionie!
Great video. Thank you SOOOO MUCHHH
Thank you sir!!!
Thankyou sir
context switches are a major factor is systems
my mother interrupted me while running this process of this video
Hey guys I'm really confused with the difference between state saving and restoring, aren't them the same ?
No, they are not same
State saving here implies saving the state of previously executing process in PCB so that when the cpu come after completing the execution of the interrupting process it continue the execution of the process from the point where it resumes.
While state restore referes to restoring the state of the new interrupting task so that cpu starts its execution.
Hope it helps!
If helping mother is another process, then is there any switch in core of the computer or same core is being used
when you say "in the previous lecture we talked about something" can you please put the link in the description for the previous video
And/or a link to the next consecutive video. I have to search for days 😵
...was the playlist not there a month ago?
Playlist is available on the channel main page. Once check
thanks
Sir upload the videos on computing environment plz
But in one of the previous video he said context switching is about changing from user mode to kernel mode and vice versa......in this video he contradicted it...i don't know someone explain please
It's mode shifting
i'm pretty sure that you have a mistake regarding the typical speeds of context switches. i belive they are in the range of microsec (not millisec).
Thanku so much.
Sir please start electromagnetism.please
Thanks a lot ..
1hr lec in clg vs 10 min here 😅
Content and context switch is same?
Thank uu a lot
❤❤❤❤❤
is nobody going to mention the use of comic sans in this video?
holy cow
holy cow
do you code
holy cow
Awesome!!!
who is responsible for doing context swichting?
You do it in the kernel
1st view, 1st like, 1st comment 😉
wr
Mom:YuanMeng!
Me:A?
5 secs silence
Me:MA?
ME:MAAAAAA?
😃💖t'hanks for sharing
Greattt !!!
process quantums are itself in milliseconds don't think context-switch will take milliseconds
I wonder why it is not called process switch.
Thankyou so much sir... 😇
You are switching "context", you go from ring 3 to ring 0 or the other way around
Present sir
So my mom calling me to clean toilet 🚻 is more important then reading 📚 books ????
ningning liu
👍👍👍
i hope i get a son like you
Mother calling is never an interrupt. How dare u 😂
You are just jumping for something you did not get the content.
HAHHAHAHA good explanation ahahhaahha