In this chapter we introduce the concepts of a process and concurrent execution; These concepts are at the very heart of modern operating systems. A process is is a program in execution and is the unit of work in a modern time-sharing system. Such a system consists of a collection of processes: Operating-system processes executing system code and user processes executing user code. All these processes can potentially execute concurrently, with the CPU (or CPUs) multiplexed among them. By switching the CPU between processes, the operating system can make the computer more productive. | Chapter 4: Processes I Process Concept I Process Scheduling I Operations on Processes I Cooperating Processes I Interprocess Communication I Communication in Client-Server Systems Operating System Concepts Silberschatz, Galvin and Gagne 2002 Process Concept I An operating system executes a variety of programs: ✦ Batch system – jobs ✦ Time-shared systems – user programs or tasks I Textbook uses the terms job and process almost interchangeably. I Process – a program in execution; process execution must progress in sequential fashion. I A process includes: ✦ program counter ✦ stack ✦ data section Operating System Concepts Silberschatz, Galvin and Gagne 2002 Process State I 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. Operating System Concepts Silberschatz, Galvin and Gagne 2002 Diagram of Process State Operating System Concepts Silberschatz, Galvin and Gagne 2002 Process Control Block (PCB) Information associated with each process. I Process state I Program counter I CPU registers I CPU scheduling information I Memory-management information I Accounting information I I/O status information Operating System Concepts Silberschatz, Galvin and Gagne 2002 Process Control Block (PCB) Operating System Concepts Silberschatz, Galvin and Gagne 2002 CPU Switch From Process to Process Operating System Concepts Silberschatz, Galvin and Gagne 2002 Process Scheduling Queues I Job queue – set of all processes in the system. I Ready queue – set of all processes residing in main memory, ready and waiting to execute. I Device queues – set of processes waiting for an I/O device. I Process migration between the various queues. Operating System Concepts Silberschatz, .