Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

process states - new state & ready state

As OS concepts book illustrate this section "Process States": Process has defined states: new, ready, running, waiting and terminated.

I have conflict between new and ready states, I know that in ready state the process is allocated in memory and all resources needed at creation time is allocated but it is only waiting for CPU time (scheduling). But what is the new state? what is the previous stage before allocating it in memory?

like image 866
Mahmoud Emam Avatar asked Jul 28 '14 16:07

Mahmoud Emam


2 Answers

All the tasks that the OS has to perform cannot be allocated memory immediately after the task is submitted to the OS. So they have to remain in the new state. The decision as to when they move to the ready state is taken by the Long term scheduler. More info about long term scheduler here http://en.wikipedia.org/wiki/Scheduling_(computing)#Long-term_scheduling

like image 181
Mahesh Jagtap Avatar answered Oct 09 '22 15:10

Mahesh Jagtap


To be more precise,the new state is for those processes which are just being created.These haven't been created fully and are in it's growing stage.

Whereas,the ready state means that the process created which is stored in PCB(Process Control Block) has got all the resources which it required for execution,but CPU is not running that process' instructions,

I am giving you a simple example :-

Say, you are having 2 processes.Process A is syncing your data over cloud storage and Process B is printing other data.

So,in case process B is getting created to be stored in PCB,the other process,Process A has been already created and is not getting the chance to run because CPU hasn't called these instructions of Process A.But,Process B requires printer to be found and other drivers to be checked.It must also check for verification of pages to be printed! So,here Process A has been created and is waiting for CPU-time---hence,in ready state. Whereas,Process B is waiting for printer to be initialised and files to be examined to be printed--->Hence,in new state(That means these processes haven't been successfully added into PCB).

One more thing to guide you isFor each process there is a Process Control Block, PCB, which stores the process-specific information.

I hope it clears your doubt.Feel free to comment whatever you don't understand...

like image 20
Am_I_Helpful Avatar answered Oct 09 '22 15:10

Am_I_Helpful