OPERATING SYSTEMS 1 龚玲 lgong@sjtu.edu.cn
OPERATING SYSTEMS 龚玲 lgong@sjtu.edu.cn 1
CHAPTER 3:PROCESSES Operating System Concepts with Java-7th Edition,Nov 15,2006 Silberschatz,Galvin and Gagne 2007
Operating System Concepts with Java – 7 th Edition, Nov 15, 2006 Silberschatz, Galvin and Gagne ©2007 CHAPTER 3: PROCESSES
CHAPTER 3:PROCESSES o Process Concept o Process Scheduling o Operations on Processes o Cooperating Processes o Inter process Communication o Communication in Client-Server Systems
CHAPTER 3: PROCESSES Process Concept Process Scheduling Operations on Processes Cooperating Processes Inter process Communication Communication in Client-Server Systems
REVIEW o Process o Process vs.Program o http://wenku.baidu.com/course/study/77fldcccda38376ba flfae94#665ea0c7aa00b52acfc7ca94
REVIEW Process Process vs. Program http://wenku.baidu.com/course/study/77f1dcccda38376ba f1fae94#665ea0c7aa00b52acfc7ca94
PROCESS CONCEPT o An operating system executes a variety of programs: ·Batch system-jobs Time-shared systems-user programs or tasks o Textbook uses the terms job and process almost interchangeably o Process-a program in execution;process execution must progress in sequential fashion o A process includes: Information related to process ·stack ·data section ·text section 。heap
PROCESS CONCEPT An operating system executes a variety of programs: Batch system – jobs Time-shared systems – user programs or tasks Textbook uses the terms job and process almost interchangeably Process – a program in execution; process execution must progress in sequential fashion A process includes: Information related to process stack data section text section heap
PROCESS IN MEMORY max stack heap data text 0
PROCESS IN MEMORY
GOALS FOR TODAY o Process o Operations on processes
GOALS FOR TODAY Process Operations on processes
PROCESS STATE o As a process executes,it changes state ● new:The process is being created running:Instructions are being executed waiting:The process is waiting for some event to occur ● ready:The process is waiting to be assigned to a process ● terminated:The process has finished execution
PROCESS STATE As a process executes, it changes state new: The process is being created running: Instructions are being executed waiting: The process is waiting for some event to occur ready: The process is waiting to be assigned to a process terminated: The process has finished execution
DIAGRAM OF PROCESS STATE new admitted interrupt exit terminated ready running 1/O or event completion scheduler dispatch 1/O or event wait waiting
DIAGRAM OF PROCESS STATE
Created Terminated Main Memory Running Ready Blocked Swapped out and waiting Swapped out and blocked Page file/swap space THE VARIOUS PROCESS STATES,DISPLAYED IN A STATE DIAGRAM,WITH ARROWS INDICATING POSSIBLE TRANSITIONS BETWEEN STATES -AS CAN BE SEEN.SOME PROCESSES ARE STORED IN MAIN MEMORY,AND SOME ARE STORED IN SECONDARY (VIRTUAL)MEMORY. Reference from http://en.wikipedia.org/wiki/Process_states
THE VARIOUS PROCESS STATES, DISPLAYED IN A STATE DIAGRAM, WITH ARROWS INDICATING POSSIBLE TRANSITIONS BETWEEN STATES - AS CAN BE SEEN, SOME PROCESSES ARE STORED IN MAIN MEMORY, AND SOME ARE STORED IN SECONDARY (VIRTUAL) MEMORY. Ready Reference from http://en.wikipedia.org/wiki/Process_states