Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Operating Systems Process Control Management Prepared by: Dhason Topic & Structure of the lesson Process Control Management • Process • Process States • Process Scheduling Operating Systems Slide 2 of 25 Learning Outcomes Process Control Management • At the end of this lecture YOU should be able to: - define the term process - identify process states - draw and explain process states using process state diagrams - describe how process scheduling works Operating Systems Slide 3 of 25 Process Process Control Management • What is a process? - it is a program in execution which progresses in a sequential manner - it is a unit of work with a unique process identification - requires resources like memory, CPU time and files to complete its task - resources are allocated when a process is created or while in execution Operating Systems Slide 4 of 25 Process (cont.) Process Control Management • • the operating system creates and deletes user and system processes a process is active while a program is passive • the operating system keeps track of processes using a process table Operating Systems Slide 5 of 25 Process State Diagram Process Control Management new exit admitted terminated Interrupt / time out ready I/O or event completion running scheduler dispatch I/O or event wait blocked Operating Systems Slide 6 of 25 Process States Process Control Management • as a program executes, it changes states • New - a process has just been created • Reasons for process creation - new batch job - interactive logon • a NEW process now becomes READY • Ready - the process is waiting to be assigned to a processor Operating Systems Slide 7 of 25 Process States (cont.) Process Control Management • READY - RUNNING - instructions are being executed - a process is using the CPU - the number of running processes will depend on the number of processors the computer has • A running process now can become BLOCKED, READY or TERMINATED • A RUNNING process becomes BLOCKED when : - the process itself cannot execute because it is waiting for an I/O operation to complete - the process is waiting for some external event to happen Operating Systems Slide 8 of 25 Process States (cont.) Process Control Management • From BLOCKED the process then becomes READY when: - an event which the process was waiting for occurs • A RUNNING process becomes READY when: - a process has reached its maximum allowable time for uninterrupted execution Operating Systems Slide 9 of 25 Process States (cont.) Process Control Management • From RUNNING the process then TERMINATES when: - a process has completed - a process has been aborted • Reasons for process termination - normal completion - invalid instruction - memory unavailable • Control is then returned to the operating system Operating Systems Slide 10 of 25 Quick Review Questions Process Control Management • For each of the following transitions between process states indicate whether the transition is possible or not possible? ready ready blocked • running new ready On a system with n number of CPU’s what is the minimum number of processes that can be in the ready, running and blocked state? Operating Systems Slide 11 of 25 Process Control Block (PCB) Process Control Management • Each process is represented in the operating system as a process control block (PCB) • a PCB: - keeps track of each process - contains information associated with a specific process - serves as a repository of any information that may vary from process to process Operating Systems Slide 12 of 25 Process Control Block Diagram Process Control Management Pointer to parent process Pointer area to child process Process state Program counter Register save area Memory limits Priority information Accounting information Pointer to files and other I/O resources Operating Systems Slide 13 of 25 Process Control Block Process Control Management • Process state – the process states; ready, running, blocked, terminated • Program counter – indicates the location for the next instruction • Priority information - CPU scheduling information • Accounting information – statistics on CPU time, job and process numbers • I/O status – list of I/O devices which are allocated to processes Operating Systems Slide 14 of 25 Process Scheduling Process Control Management • As processes enter the system, they are put on the job queue • A new process is put on the ready queue • The process waits until it is selected for execution or dispatched and given CPU resources • Once CPU is allocated the process then runs: - the process could issue an I/O request and be placed on a device queue or I/O queue - the process could create a new sub-process - the process could be forcibly removed Operating Systems Slide 15 of 25 Process Scheduling Diagram Process Control Management ready queue I/O CPU I/O queue I/O request time slice expired child executes interrupt occurs Operating Systems fork a child wait for an interrupt Slide 16 of 25 Quick Review Questions Process Control Management • What is a process control block? Operating Systems Slide 17 of 25 Summary of Main Teaching Points Process Control Management • A process is a unit of work in execution which requires resources. • The state of a process changes as it executes. • A process control block represents a process in the operating system. • Processes can execute concurrently or independently from each other. • Operating Systems Slide 18 of 25 Question and Answer Session Process Control Management Q&A Operating Systems Slide 19 of 25 Next Session Process Control Management CPU Scheduling Operating Systems Slide 20 of 25