Topics- Process lifecycleProcess schedulingContext switchingScheduling criteriaScheduling algorithmsApplications/Scenarios(intel)Core"i76
6 Topics - Process lifecycle - Process scheduling - Context switching - Scheduling criteria - Scheduling algorithms - Applications/Scenarios
Programmer'spointofview.. This is how a fresh programmer looks at a processlife cycle.int main(void)(3)intx=1;Runninggetchar();Terminationreturnx;(1)(2)Waitingfor resultsProcessStates
Programmer’s point of view. • This is how a fresh programmer looks at a process’ life cycle. 7 Running Waiting for results Termination Process States int main(void) { int x = 1; getchar(); return x; } (1) (2) (3)
Kernel's point of view..Big PictureNewTerminated(Justfork()-ed)(Zombie)ReadyRunningWaiting(blocked)ProcessStates8
Kernel’s point of view. 8 New (Just fork()-ed) Waiting (blocked) Terminated (Zombie) Process States Ready Running Big Picture
Kernel's point of view..The birth of aprocess.Exceptthefirstprocess"init"every process is created usingNewTerminatedfork().ReadyRunningWaiting(blocked)ProcessStates9
Kernel’s point of view. 9 Process States Ready Running The birth of a process. Except the first process “init”, every process is created using fork(). New Waiting (blocked) Terminated
Kernel's point of view..TheprocessisreadyIt means it is ready to run but is notrunningNewA process may become"ready" after...- it is just created by fork();- it has been running on the CPUforsometimeandtheOS choosesReadyanotherprocessto run;-returningfromblockedstates.All ready processes are kept on a listWait.called ready queuePCBTPCBzqueueheaderProcessheadreadyqueuetailStatesregistersregisters10
Kernel’s point of view. 10 Process States Ready Running New Waiting (blocked) Terminated The process is ready. It means it is ready to run but is not running. A process may become “ready” after. - it is just created by fork(); - it has been running on the CPU for some time and the OS chooses another process to run; - returning from blocked states. All ready processes are kept on a list called ready queue