So you can also use defreeze to implement busy little.
So can we do that?
We can spin in a loop until the desired number of defeats, but we can have a look and you can wait
until that main number of defeats completel passed so that.
Simple, suppose I want to lead for two seconds so I know how many dicks will be incrementally in two
seconds, I just need to multiply it for two seconds.
I need to multiply it by two in two has my time so I know the initial value and I have to wait for two
seconds so I can just say ten more because the current value let's do it has said this many amount of
the will be implemented in two seconds, then I can use my muskat before and I can see DeFries and timer.
So I want to ask before will return to.
When this particular disease is less, then this particular time the before it becomes more than this
one that unfolds and while will come out and this will.
So this using this, you can implement busy mapping.
So it is simple using which you can implement.
Defense using the physical we implement with a.
So you can see it was seventy five.
It is 77.
It was two seconds of silence has been uttered because of using that little.
So what is the problem with this approach?
The problem with this approach is the process that is tied up.
Spinning is silly loop.
This is not doing any useful work.
So what is a better solution for this in the previous approach?
You are just doing a while and there was a semicolon.
So nothing, no useful work is that we're just spinning in a loop.
So that solution is we have to risk a lot riskier process.
To allow the process to accomplish other worthwhile cause, it's OK to do that.
So using.
Calling and so this particular function, when I invoke the scheduler, only if there is a more important
task to the.
So this donation you're asking the state to invoke any more important to us.
It's possible.
So this will only run any important task.
So we can call this capital on the schedule and it will check if there is any important task and we
will run it.
So an important point is this cannot be used and it can only be used in this process context.
The previous approach can be used.
And then in Chapter 11, this approach cannot be used.
And in fact, it can only be used in the process context.
So this is the approach of using this ruling, calling this, can you let any more of that process develop
completes?
So can see we still got two second delay, but we have efficiently used the process a little.
So one more example regarding time out, you can also use continue here, so.
Instilling the values diffuse now and then, I'm taking a longer time out of five seconds, so I'm not
waiting for five seconds in this very busy building and letting the process of.
I'm just spinning, doing nothing, and then you reap the benefits.
So what is the output of this particular statement time after time before?
So you have already stored defense values in previous years to bring it in no defense.
That is a no.
So we the know is after previous or is it before previous?
It should be always of the noise of the previous.
So this will be one.
I know it's not before previous, so this will be zero and this will be one and this museum.
So has their values, 250, 50 we have seen.
I can see it is one zero and one zero.