Chương 3 - Memory management. Bài giảng gồm có những nội dung chính sau: Resource, introduction to deadlocks, the ostrich algorithm, deadlock detection and recovery, deadlock avoidance, deadlock prevention, other issues. | Chapter 3. Process OBJECTIVES To introduce the notion of a process - a program in execution, which forms the basis of all computation. To describe the various features of processes, including scheduling, creation and termination, and communication. To describe communication in client-server systems. 1. Process Concept An operating system executes a variety of programs: Batch system –jobs Time-shared systems –user programs or tasks A user may be able to run several programs at one time: a word processor, a web browser, and an e-mail package. Process is a program in execution; process execution must progress in sequential fashion . The Process A process includes The current activity, as represented by the value of the program counter and the contents of the processor's registers. The stack, which contains temporary data (such as function parameters, return addresses, and local variables) A data section, which contains global variables. A process may also include a heap, which is memory that is dynamically allocated during process run time. Figure 1. Process in memory. Process State As a process executes, it changes state. Each process may be in one of the following states: New. The process is being created. Running. Instructions are being executed. Waiting. The process is waiting for some event to occur (such as an I/O completion or reception of a signal). Ready. The process is waiting to be assigned to a processor. Terminated. The process has finished execution. Figure 2. Diagram of process state. It is important to realize that only one process can be running on any processor at any instant. Many processes may be ready. Process Control Block (PCB) Each process is represented in the operating system by a process control block (PCB)—also called a task control block. Figure 3. Process control block (PCB). Process state. The state may be new, ready, running, waiting and halted. Program counter. The counter indicates the address of the next instruction to . | Chapter 3. Process OBJECTIVES To introduce the notion of a process - a program in execution, which forms the basis of all computation. To describe the various features of processes, including scheduling, creation and termination, and communication. To describe communication in client-server systems. 1. Process Concept An operating system executes a variety of programs: Batch system –jobs Time-shared systems –user programs or tasks A user may be able to run several programs at one time: a word processor, a web browser, and an e-mail package. Process is a program in execution; process execution must progress in sequential fashion . The Process A process includes The current activity, as represented by the value of the program counter and the contents of the processor's registers. The stack, which contains temporary data (such as function parameters, return addresses, and local variables) A data section, which contains global variables. A process may also include a heap, which is .