Hello and welcome everyone.
In this video, we are going to talk about thrashing.
So what is thrashing?
Well, thrashing is the situation.
One system is spending most of the time in servicing the pitfalls and rather than executing the actual
process.
So we have learned in the previous videos that when we have made memory and secondly, MDM, there's
a process that is requesting a page that does not exist in the main memory.
Then based fault occurs, right?
And then because it needs that page, it doesn't exist in the main memory.
There's a swap in, swap out and swap in.
Happen happens.
For instance, it requires if a request, page five, then Page four is going to be swapped and or if
it requires, let's say, Page five.
So, for instance, page one is going to be swap.
It goes to the secondary memory and the Page five comes into the main memory.
OK.
So when does that thrashing happens?
So if a process is allocated to few frames, then they will be two frequent pitfalls.
And as a result, no useful work will be done by the CPU and sip utilization will fall drastically.
And this drastic fall of the CPU utilization is called thrashing.
So let me show you.
So let's say in this diagram, we have the CPU utilization, which is which goes up in this direction
and then we have a degree of programming.
So degree of programming means the number of processes at a particular time.
So if we are saying increase, the degree of programming means increase the number process just a concept.
OK, so the CPU should have as many processes as possible so that the degree of programming is high
and are supposed utilised fully and it's not sitting idle.
Right.
So that is why from here, if you look at the graph, this is a utilization.
This is the degree of programming, which means when the degree of programming increase, the number
of processors increases in the CPU, then the CPU utilization increases.
So like this, it goes up.
But at this point, be there will be a point that will come and at that stage, probably there won't
be enough frames available.
So the swapping would happen.
And as soon as the swapping happens, Scipio will become busy in getting those pages around, then doing
the actual task.
And from this point onwards, the sip utilization will fall down is because the CPU is busy for doing
the swapping of the pages rather than doing the actual task.
OK, so at this point, operating system would think that it needs to increase the degree of programming,
so it didn't start increasing the number of processes.
That means that the long term scheduler would try to load more processors into the main memory to improve
the CPU utilization.
But the problem is that.
This will result in further decrease in the CPU utilization, because those additional processes that
will be added over here that will be added over here would trigger another chain of reaction for higher
base faults.
OK, because when those pages are not available, if you keep on increasing the processes, but you
know you don't have enough frames available, and if those pages are not available in the main memory,
more page portals would occur, which means you will get busy in getting those pages from the secondary
memory into the main memory, and stipulation will continue to fall.
So system will continue to increase the degree of programming.
But because of those pages not being present in the main memory, um, pricing would occur.
That means baseball will continue to occur and system is not actually doing any useful work, but it's
basically busy doing the base swapping.
OK, so that is the concept of thrashing.
All right.
So in the next video, we will discuss about what are the techniques we can use to avoid thrashing.