L-1.5: Process States in Operating System| Schedulers(Long term,Short term,Medium term)

Gate Smashers
16 Feb 202020:54

Summary

TLDRIn this video from Gate Smashers, the concept of process states or the process life cycle is explained. It covers the primary states (new, ready, running, terminated, wait/block) and additional states (suspend wait/block, suspend ready). The video details how processes move through these states, the role of schedulers (long-term, short-term, medium-term), and concepts like multi-programming and multi-tasking. The explanation includes practical examples and mentions how to view processes in Windows and UNIX/Linux. This comprehensive guide is useful for competitive and university exams.

Takeaways

  • πŸ˜€ The video discusses the process states or life cycle, which is crucial for understanding how processes operate in systems like laptops, PCs, and mobiles.
  • πŸ“š The primary states of a process are New, Ready, Running, Wait/Block, and Terminated. These are essential stages a process goes through from start to end.
  • πŸ’» The 'New' state refers to a process that has been created but not yet executed, typically stored in secondary memory.
  • πŸ” When a process is 'Ready', it has been brought into RAM and is waiting to be executed by the CPU.
  • πŸƒβ€β™‚οΈ The 'Running' state is when a process is actively being executed by the CPU, and it is in this state that the process performs its tasks.
  • πŸ”„ The 'Wait/Block' state occurs when a process is waiting for an I/O request, such as reading from secondary memory, and is temporarily halted.
  • 🏁 The 'Terminated' state signifies the end of a process's life cycle, where it has completed its execution and resources are deallocated.
  • πŸ”„ The Long-term Scheduler is responsible for bringing processes into the Ready state, contributing to the concept of multi-programming.
  • πŸ”„ The Short-term Scheduler picks processes from the Ready state and sends them to the Running state, managing the execution of processes on the CPU.
  • πŸ”„ The Medium-term Scheduler handles processes that need to be swapped out of RAM to secondary memory due to limited resources or high priority processes needing execution.
  • πŸ”„ The concepts of multi-tasking and pre-emptive scheduling are important for understanding how multiple processes are managed and prioritized in a system.

Q & A

  • What is the purpose of the process life cycle model?

    -The process life cycle model is created to explain the various states a process goes through from its start to its end, helping users understand how a process evolves and changes its status during execution.

  • What are the primary states of a process according to the script?

    -The primary states of a process are New, Ready, Running, Waiting/Block, and Terminated. These states are mandatory and present by default in the process life cycle.

  • What is the 'New' state in the context of process states?

    -The 'New' state refers to the initial stage of a process's life cycle when it is created but not yet executed. It is stored in secondary memory and is in a stable state.

  • What is the role of the long-term scheduler in process management?

    -The long-term scheduler is responsible for bringing processes from the secondary memory into the ready state in RAM, facilitating multiprogramming by managing how many processes are in the ready queue.

  • How does the script describe the 'Ready' state of a process?

    -In the 'Ready' state, a process has been loaded into RAM and is waiting in the ready queue to be executed by the CPU. It is in an active state, ready to be scheduled for execution.

  • What is the significance of the 'Running' state in a process's life cycle?

    -The 'Running' state signifies that the process is currently being executed by the CPU. It is in this state that the process performs its designated tasks and operations.

  • What does the script mean by 'Terminated' state?

    -The 'Terminated' state indicates that a process has completed its execution. In this state, the process releases its allocated resources and exits the CPU's execution cycle.

  • What is the concept of multiprogramming as explained in the script?

    -Multiprogramming is the concept of bringing as many processes as possible into the ready queue, allowing for efficient use of the CPU and memory resources, and enabling the system to handle multiple tasks concurrently.

  • What is the difference between non-preemptive and preemptive scheduling as described in the script?

    -Non-preemptive scheduling means a process runs to completion without interruption, whereas preemptive scheduling allows for a process to be interrupted during its execution due to factors like higher priority processes or time quantum expiration.

  • What is the role of the short-term scheduler in process management?

    -The short-term scheduler is responsible for selecting a process from the ready queue and dispatching it to the running state. It plays a crucial role in process execution and task switching.

  • What does the script imply by the 'Wait/Block' state?

    -The 'Wait/Block' state is when a process is waiting for an I/O operation to complete, such as reading from secondary memory. During this state, the process is paused and will return to the ready state once the I/O request is fulfilled.

  • What are the additional states mentioned in the script, and what are they used for?

    -The additional states mentioned are Suspend Wait/Block and Suspend Ready. These states are used when the respective queues for waiting processes or ready processes are full, and the process needs to be temporarily moved to secondary memory until space becomes available.

  • What is the function of the medium-term scheduler as per the script?

    -The medium-term scheduler handles processes when the system's RAM or queues are full. It decides which processes to swap out to secondary memory based on certain scheduling algorithms, making space for new or high-priority processes.

Outlines

00:00

πŸš€ Introduction to Process States and Life Cycle

This paragraph introduces the concept of process states and their life cycle, emphasizing their importance for understanding how processes operate within a system. The speaker invites viewers to engage with the content by liking, subscribing, and turning on notifications. The primary focus is on the primary states of a process: New, Ready, Running, Waiting/Blocked, and Terminated. These states are essential for understanding how a process evolves from creation to completion. The paragraph also hints at additional states that will be discussed later, setting the stage for a deeper dive into process management.

05:01

πŸ” Exploring the New and Ready States

The speaker delves into the specifics of the New and Ready states. The New state is described as the initial phase where a process is created but not yet executed, such as a program written in C language that is stored but not run. The Ready state is when a process is brought into RAM, making it eligible for execution. The paragraph explains the role of the long-term scheduler in moving processes from the New state to the Ready state, highlighting the concept of multi-programming, which involves loading multiple processes into the Ready queue to maximize CPU utilization.

10:04

πŸƒβ€β™‚οΈ Transitioning from Ready to Running State

This paragraph discusses the transition of a process from the Ready state to the Running state. The speaker explains that the process is moved to the CPU for execution, which is the Running state. The emphasis is on the execution of processes, with the CPU handling the instructions one by one. The paragraph also touches on the differences between uni-processor and multi-processor systems, and how these affect the execution of processes. The concept of deallocation is introduced when a process completes its execution and is terminated, freeing up resources.

15:04

πŸ”„ Understanding Pre-emptive and Non-Preemptive Scheduling

The speaker introduces the concepts of pre-emptive and non-preemptive scheduling, explaining how these affect the execution of processes. In non-preemptive scheduling, a process runs to completion without interruption, whereas in pre-emptive scheduling, a process can be interrupted and resumed later based on priority or time quantum. The paragraph also discusses the role of the short-term scheduler in picking processes from the Ready state and moving them to the Running state, emphasizing the importance of these concepts in operating systems.

20:10

πŸ›‘ Handling IO Requests and Wait/Block State

This paragraph addresses the handling of IO requests by processes and the resulting Wait/Block state. When a process requests IO, such as reading from secondary memory, it is moved to the Wait state, which is still in RAM but with a changed status. The speaker uses an analogy of a supermarket to explain why processes are moved to the Wait state, highlighting the inefficiency of CPU waiting for slow IO operations. The paragraph also discusses the role of the medium-term scheduler in managing processes that need to be suspended due to full wait queues or full ready queues.

πŸ”„ Additional States and Schedulers in Process Management

The final paragraph covers additional states in the process life cycle, such as the Suspend Wait or Block state, which occurs when the wait queue is full and processes need to be moved back to secondary memory. The speaker explains the role of the medium-term scheduler in managing these states, deciding which processes to swap out based on criteria like frequency of use or priority. The paragraph also touches on the concept of backing store, where processes are temporarily stored in secondary memory before being moved back to the ready state. The speaker concludes by emphasizing the relevance of these concepts in competitive exams and system management.

Mindmap

Keywords

πŸ’‘Process States

Process States refer to the various stages a process goes through during its lifecycle in a computer system. In the video, the focus is on understanding these states to gain insights into how processes are managed by an operating system. The script mentions primary states such as 'New', 'Ready', 'Running', 'Terminated', and 'Wait/Block', which are essential for comprehending the process life cycle.

πŸ’‘Process Life Cycle

The Process Life Cycle is a model that outlines the sequence of stages a process undergoes from its creation to termination. The video script discusses this concept to help viewers understand how a process evolves from initiation to completion, emphasizing the importance of each state in the process's journey.

πŸ’‘Kernel

The Kernel is the core part of an operating system that has control over everything in the system. In the context of the video, the script explains that the concept of process states is a model created to help users understand what the kernel does with processes from the time they are started until they are finished.

πŸ’‘Multi-programming

Multi-programming is a technique used by operating systems to increase the efficiency of the CPU by keeping multiple processes in the 'Ready' state. The script mentions this concept to illustrate how an operating system can have multiple processes waiting in the 'Ready Queue' for execution, which is managed by the long-term scheduler.

πŸ’‘Long-term Scheduler

The Long-term Scheduler is responsible for bringing processes from secondary memory into the 'Ready' state in primary memory. The script describes its role in the process life cycle, particularly in managing multi-programming by selecting which processes to place in the ready queue for potential execution.

πŸ’‘Short-term Scheduler

The Short-term Scheduler, also known as the CPU scheduler, selects a process from the 'Ready' queue and allocates the CPU to it. The script explains its function in the process life cycle, highlighting its role in deciding which process to move from the 'Ready' state to the 'Running' state.

πŸ’‘Pre-emptive Scheduling

Pre-emptive Scheduling is a method where a running process can be interrupted by the scheduler to allow another process to run. The script discusses this concept to explain how processes can be paused and resumed based on priority or time quantum expiration, which is a key aspect of multi-tasking.

πŸ’‘Non-preemptive Scheduling

Non-preemptive Scheduling is a method where a process runs to completion without being interrupted by the scheduler. The script contrasts this with pre-emptive scheduling to illustrate different approaches to process execution, emphasizing that in non-preemptive scheduling, once a process starts running, it continues until it finishes.

πŸ’‘I/O Request

An I/O Request is a process's request to read from or write to an input/output device. The script uses this concept to explain how a process in the 'Running' state may need to wait if it requires data from secondary storage, moving it to the 'Wait/Block' state until the I/O operation is complete.

πŸ’‘Suspend State

The Suspend State is a condition where a process is moved out of primary memory and into secondary storage when the system is under heavy load or when the process queue is full. The script describes this state in the context of managing processes when the system's resources are constrained, such as when the 'Wait/Block' queue is full.

πŸ’‘Medium-term Scheduler

The Medium-term Scheduler is responsible for moving processes between primary and secondary memory based on system load and resource availability. The script mentions this scheduler's role in managing system resources efficiently, particularly when the 'Ready' or 'Wait/Block' queues are full, by swapping processes out to secondary memory.

Highlights

Introduction to process states and life cycle in the context of operating systems.

Explanation of process states as a model to understand how processes evolve from start to end.

Identification of primary states: New, Ready, Running, Wait/Block, and Terminated.

Description of the New state as the initial phase where a process is created but not yet executed.

Transition from New to Ready state when a process is loaded into RAM and becomes eligible for CPU time.

Role of the Long-term scheduler in bringing processes into the Ready state for multiprogramming.

Concept of multiprogramming explained as increasing the number of processes in the Ready queue.

Discussion on the Running state where a process is actively being executed by the CPU.

Impact of CPU type (uni-processor vs. multi-processor) on the number of processes that can be in the Running state.

Transition to the Terminated state when a process completes its execution and resources are deallocated.

Introduction of the concept of preemptive and non-preemptive scheduling in the context of process execution.

Explanation of the Wait/Block state when a process is waiting for IO operations to complete.

Role of the Short-term scheduler in picking processes from the Ready state to the Running state.

Discussion on the Round Robin scheduling method and its use of time quantum for process execution.

Introduction of additional states like Suspend Wait/Block and Suspend Ready for managing processes when queues are full.

Responsibility of the Medium-term scheduler in handling process suspension and resumption based on system needs.

Practical applications of process states in Windows Task Manager and UNIX/Linux systems for process management.

Summary of the importance of understanding process states for competitive exams and real-world applications.

Transcripts

play00:00

Hello friends... Welcome to Gate Smashers

play00:03

In this video we are going to discuss process states or you can call it as process life cycle also

play00:08

And in this video we're going to discuss all important points related to process states and life cycle

play00:13

that'll be beneficial for your competitive exams even for your college\university level exams also

play00:19

so like the video quickly and subscribe the channel if you haven't done until now

play00:23

and please press the bell button so you can keep getting all latest notifications

play00:27

So let's start with something related to process states, let me tell you first important point

play00:32

if we'll talk in technical term, or you'd say that kernal knows what are process states

play00:39

NO... This is a model created just to explain the user that whenever we starts a process in our laptop, PC or mobile

play00:47

so in between from start to end,

play00:50

from which states it pass through which of its status it changes

play00:55

so to understand this we've created a model so you'll get an idea

play01:00

that how process grows and moves from start to end

play01:06

so first we are talking about primary states here

play01:09

primary states means those which are mandatory which are present by default

play01:12

so those are New, ready, running, terminated and wait \ block

play01:17

other than this there are some additional states also that we'll discuss further

play01:21

so first of all let's start with new state New state means when we created the process

play01:28

Now creating a process means, that let's suppose that you wrote a program in C language

play01:34

Now right after writing let's suppose you stored it

play01:38

Right now you didn't run it, just stored it means placed in secondary memory permanently

play01:43

Means it's staying in a stable state, that's called a new state,

play01:46

or let's say you turned on an application

play01:49

You turned on Mozilla Firefox, or chrome, or opened VMware in your laptop

play01:55

Or even if you turns on laptop, then by default when your operating system gets mount in the memory

play02:00

Then a lot of process starts running at the background so in actual its a new state

play02:07

Means there was no process before that, but now we created a new process

play02:11

right after creating we just poked it, now it came in an active state,

play02:17

active state means ready state

play02:20

You can say ready state or you can call it as ready queue also

play02:23

Ready queue means that now that process came into RAM

play02:29

means now it came in faster memory, before that it was staying stable

play02:32

But the moment you poked it or turned it on

play02:35

now it came in ready state, now it's staying in the RAM

play02:38

Now after coming in RAM, means here it came in queue after first in, first out

play02:44

all these our process are coming in the queue

play02:47

but remember that there could be many processes in the secondary memory

play02:51

Because we are considering our secondary memory very big

play02:54

You can see these days your laptops are getting secondary memory or hard disks of 1 terabits

play03:00

that's more than sufficient...

play03:02

But... Talking about the RAM,

play03:04

then we have up to 4gb, 8gb. Maximum we are using up to 16gb

play03:09

so here you can't bring all processes in the ready state

play03:14

Out of all the "n" number of processes,

play03:17

Out of "n", we brings only some no. of processes in the ready state

play03:21

but who brings these processes...

play03:26

it's long term scheduler who brings all the processes

play03:28

Yess... long term scheduler and points related to scheduler,

play03:33

I'm discussing all that in this video,

play03:35

because in next video I won't tell any point related to it

play03:38

because all that will be covered in this same video

play03:41

Now what is the meaning or concept of long term scheduler here

play03:46

the meaning is to bring more and more processes in the ready state

play03:49

Which we call the concept of multi programming

play03:52

Multi programming means bringing more and more concept in the ready queue

play03:56

I've already made a video on what multi programming actually is

play03:59

And it's link is in the description box Make sure to check it once

play04:03

All the points that I'm using here like multi programming, multi-tasking,

play04:07

you'll get its all detail there

play04:10

Now what we are trying is

play04:11

to keep bringing more and more process in the ready queue or ready state

play04:18

Now after that... Let's suppose we brought as much processes as possible

play04:21

Now what we have to do is Our task is not to fill ready queue

play04:25

Now we have to execute those processes Now every process wants to get CPU for some time

play04:31

so it can get terminated after execution

play04:34

Now what we are doing is, now all the processes that came in ready queue already

play04:40

we dispatched some of them from it

play04:44

Now what dispatch actually means, or you can say we scheduled it

play04:50

we brought it in the running state

play04:54

Now how many processes we'll bring in the running state

play04:57

This depends on how much CPU you have

play05:00

Because running state means we are executing that process

play05:04

Now we are providing it CPU to get executed

play05:07

But if you have uni processor system then we have one CPU

play05:12

If you have multi-processor system, you have grid computing or if you are using advance system

play05:17

then you can say you have multiple series then you can use parallel processing

play05:21

But whatever syllabus of operating system we have at present, we are assuming that we have uni processor system

play05:29

so you can say, out of all the processes in the queue state,

play05:33

means I just picked out one from those which are in ready state

play05:37

And I scheduled and dispatched that one on the CPU,

play05:41

Means now we gave it to CPU allowing CPU to execute it

play05:46

Now where is that process staying? Process is still in the RAM,

play05:50

but its status got changed and

play05:52

it got a new address at a new place where CPU is executing it

play05:58

All the arithmetic logic and instructions that we want to run in it,

play06:01

we are giving that instructions to CPU one by one and CPU is executing all that

play06:06

This is the running state, now in running state if there's uni processor, I told you already, only one processor will run

play06:13

If it's multi-processor then you can run multiple processes

play06:16

But we are assuming it as uni processor

play06:19

so out of all processes we picked out one and gave to CPU

play06:22

Now CPU started doing execution on it after doing one, two, three, four... instructions

play06:29

When it completed all the instructions, means processor got terminated

play06:35

and terminate means deallocation Deallocation means....

play06:40

when process came in ready state in the RAM we provided it some address and resources

play06:47

Now when that process is going back and completed, now take those resources back

play06:52

, as we have limited RAM so we can't distribute resources freely, we have limited

play06:59

When we have something limited then we'll utilize it properly,

play07:03

so now we deallocated with it, means took all address and resources back that we provided it

play07:10

and it got terminated, means finished and it's status got completed

play07:17

This is the normal phase we have,

play07:19

that process is coming and passing though all these stages

play07:24

But... second concept here is, let's suppose we shifted it from ready to running state

play07:29

Now that process was going on in running state but suddenly a high priority process came in ready state

play07:38

And we gave it to CPU to execute this process first,

play07:44

now executing this process means,

play07:46

that the process it was working on before, that will be sent back in the ready queue

play07:51

Why we sent it back?

play07:53

One of the reasons is priority priority means... Here the concept is of multi-tasking

play07:59

Multi-tasking means that you are executing multiple processes at a time

play08:06

Before that we talked about multi programming, means bringing as much processes as possible

play08:10

Out of those, we gave one to CPU But if the CPU is completing it whole

play08:18

then multi-tasking haven't been done here but if we asked to stop the running process in the middle

play08:25

But a VIP process came for example,

play08:32

we asked CPU to execute it first, then execute the old one

play08:38

So when we gave that process to CPU But CPU can do only one process at a time

play08:42

So it'll send back the old on process, on which it was already working before

play08:47

Means we sent it back in the ready state because a high priority process came

play08:53

It's other reason could be... time quantum

play08:58

Means, there's a scheduling method called round robin in which we are talking about time quantum

play09:03

In this we says that we gave one process to CPU But CPU will run that process up to a fixed amount of itme

play09:11

The moment that time quantum got expired

play09:15

CPU will ask it to return back, saying that it'll run next process

play09:19

But just for limited time quantum

play09:22

Let's suppose time quantum is 2 sec then CPU will run every process up to 2 sec only

play09:27

then it'll send it back, then it will again get its turn in future

play09:30

But if the process got ended in 2 sec, then it'll get terminated,

play09:34

but if not ended in 2 sec, then we'll send it back again in the ready state

play09:39

and will keep running the new process so the scheduler which is helping here is.... Short term scheduler

play09:47

So the next we have is short term scheduler

play09:51

whose responsibility is to pick a process from ready state and send it in the running state

play09:57

Now if CPU is executing it completely, then it means multi-tasking did not happened

play10:03

which you can call non pre-emptive

play10:06

These topics gets used so much Non pre-emptive and pre-emptive

play10:11

Non pre-emptive means if CPU will run a process completely,

play10:18

with no priority or time quantum in between Means if this line is not there

play10:24

Then you can say it's non pre-emptive, non pre-emptive means

play10:28

no process will get jumped in between

play10:31

and the other concept we have is pre-emptive

play10:33

Here pre-emptive means that if we are stopping running process in between

play10:39

because maybe a high priority came or its time quantum got expired

play10:43

then it's called pre-emptive

play10:44

so if this line is attached then you'll say pre-emptive

play10:47

or if this line is not attached then you'll say this is a non pre-emptive type of scheduling

play10:53

so these are very important points these can directly come in your exam

play10:57

so just keep all these points in your mind

play11:00

So now short term scheduling is clear to you, it's responsibility is to dispatch

play11:07

Next, the third case that comes here is

play11:11

Let's suppose we gave a process to CPU and CPU is continuously executing that process

play11:16

IN between process said that it wants to give an IO request

play11:21

Io request means like if it said that it wants to read a particular file

play11:28

And that file is in secondary memory now if it wants to read from the secondary memory

play11:33

then CPU will say, I can't help anything in this, I would suggest you to go in the waiting state or get block...

play11:41

and waiting state is also in the RAM But we changed its status saying to go in wait state

play11:48

Because reading secondary memory means...

play11:51

CPU works in MILLION instructions per second, it complete works in micro seconds

play11:58

But our secondary memory is slow, and if it'll wait for secondary memory

play12:02

then other processes will keep waiting

play12:05

If we'll take a simple example, let's suppose you went to a super market

play12:11

Then many times it happens that you are going to get bill, some other bill is already processing before it

play12:16

And what they do is, they says to buy other things also while bill is on its process

play12:26

They went somewhere else leaving the bill in the mid-way

play12:29

If they went somewhere else, then if the billing person will ask others to wait

play12:36

Then obviously people would start cursing saying what's wrong!.. do his billing later and attend us first

play12:42

So it's the same case here, process said here...

play12:46

before in these cases CPU said that it'll run those with higher priority first

play12:51

or your process's time quantum is over and you must go back

play12:55

But in this case, process is saying itself that it wants to read some file

play13:01

or wants to access monitor or any other hardware, then CPU will ask it to go in wait state

play13:08

Means get block for some time, that's called an I\O request

play13:12

Now when its IO request got completed, file and data is done reading... Means its IO got completed

play13:20

Now it won't go back in the running state, there would some other process already in the running state

play13:26

then we'll ask it to come back in the ready state

play13:30

But now you won't go in running state, you just come here in the ready queue, and we'll get your turn in ready queue

play13:36

So this is the wait/Block state, which is important when any process demands for an IO

play13:42

like if it wants to read some secondary memory or hardware

play13:46

then CPU will say to wait aside and do the work, and in future you'll get your turn in the ready state

play13:55

So these are all primary states which are related to the process life cycle

play13:59

Other than this we have now additional states additional states are those...

play14:04

Let's suppose if we'll talk about worst case Let's suppose the number of processes we had were 10

play14:09

We created 10 processes, and we brought all 10 in the ready state

play14:13

and then we gave first one to CPU to execute it

play14:17

That first one said it wants to do IO request or wants to read secondary memory

play14:21

we allowed and sent it here and gave second one to the CPU

play14:25

Second also said to do IO, we sent it same with third one...

play14:33

We gave the fourth one, then it also asked to go so in worst cake they all may ask to do IO request

play14:39

Then what will happen is, this state which is also in RAM So it is also a queue, a wait queue

play14:46

so this queue can get full, now this queue got filled and we have limited RAM

play14:51

so we'll say to suspend for some time we created a suspend wait or block state

play15:00

And what we are doing here actually, this queue is filled

play15:04

now we'll say that we've swapped out for sometime Swap out means we sent in back in the secondary memory

play15:12

CPU said like, alright you can do there because this queue that we have is already filled

play15:19

Now we don't have any other option so we'll say fine... get suspended for some time

play15:24

Means you can go in the secondary memory and can continue your work

play15:29

When it'll be completed, then you can come back in the wait state

play15:32

If there'll be space then it can come back otherwise you can wait in suspend weight for some time

play15:40

And whose work it actually is? who handles all that actually? this is done by medium turn scheduler

play15:46

Medium turn scheduler's work here is, like if your RAM is getting filled

play15:52

due to ready state or anything else that we discussed here,

play15:56

if there's any reason related to it due to which RAM is getting filled

play15:59

then we'll ask it to go to secondary memory for some time,

play16:02

means we swapped it out with RAM and sent it secondary memory

play16:08

One more reason that could be here let's suppose you are filling new new processes

play16:15

You are bringing all of them in ready state or ready queue in RAM

play16:19

It could be possible that your this queue also got filled

play16:22

so you asked other processes to stop because ready queue got filled

play16:27

But that time some VIP process came Means some system or kernel process

play16:32

that says It has the highest priority, I have VIP tag... But our ready queue is already full

play16:40

Now what we'll do... we'll place it in a suspend ready state from ready queue

play16:51

or when its work will be done or there'll be some space in the ready queue

play16:56

Then we'll resume it again, and will bring it back in the ready state again

play17:00

So suspend is possible here also

play17:03

but it's possible when your ready state got full with new processes, that's our task and we have to do it

play17:11

But if some VVIP process arrived then we have to make some space

play17:16

That work is also handled by the same one

play17:18

The way mid tern scheduler is working here, same way it's working here also

play17:23

so the difference here is only that

play17:26

we sent it back from the ready state, but here it was waiting and completing the IO work

play17:34

CPU sent it here to do its IO work But this also got filled

play17:39

then we sent it to secondary memory that here you can do your IO work now

play17:44

Now from here, it's trying continuously to get into wait state

play17:49

If it went in wait state and this queue gets empty, then it'll go there

play17:53

If it's not empty in case, there's more processes coming in the block state

play17:57

Then we calls it backing store... Backing store mean that we'll send it back here

play18:04

Because what's its ultimate purpose? Where it wants to go from here?

play18:07

Now it wants to reach from here to here But i can't reach directly from here

play18:11

First we have to send it here, and from here to ready state,

play18:15

but this is filled already, now either it'll just keep sitting here. But it won't keep sitting here.

play18:20

If its work got completed then we backing store it and sent it in ready state

play18:28

but if ready queue is also filled then send it in suspend ready state

play18:33

Just let it wait there... from there it'll get priority and from here you'll get resume and moved in ready state

play18:41

So they've added some extra states, this is just very simple concept like virtual memory, swap in- swap out

play18:49

Like we have some processes based on firm scheduler like we have least frequently used or most frequently used

play18:58

Based on that we do filtering of some processes so we can send few of them back

play19:04

so we can create more space, so some more processes or high priority processes can come in ready queue

play19:10

or some processes can come in wait block

play19:13

Because CPU is sending here continuously But if it got filled then I have to use secondary memory lastly

play19:21

But which processes I'll send?? Based on some scheduler...

play19:24

That medium term scheduler will handle it own its own Whether it'll send least frequently, or most or based on priority

play19:34

It can use any logic here,

play19:36

so we were discussing what are those all primary and secondary states

play19:40

So all these points will help you so much in competitive exams

play19:46

So talking about window's If you'll open Window's task manager

play19:50

Then there's a process tab where it shows a whole list of all processes running in the system

play19:57

That what are system processes, which one are user processes

play20:00

And If we'd talk about UNIX or LINUX

play20:02

then there you can get all process information through PS (process state) command

play20:10

Although there's a lot of variations in it like PS-e, PS-u etc.. but in general, It's PS command

play20:17

through which you can get process ID and which command the process is executing

play20:23

or until when it's been running on the CPU So all these states will give you benefit here

play20:29

Long term scheduler, short term scheduler, medium term scheduler pre-emptive, non pre-emptive

play20:33

Here I have completed all the aspects

play20:36

So I already told you what is multi tasking and multi programming

play20:40

You'll get a link in the description,

play20:42

Make sure to check once so you'll understand in detail what pre-emptive, non pre-emptive, multi-tasking etc. is...

play20:49

Thank You!!

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
Process StatesLife CycleOperating SystemsCompetitive ExamsTech EducationProcess SchedulingMulti-TaskingMulti-ProgrammingCPU ExecutionSystem Management