Operating Systems Process Scheduling Queues 进程调度队列 G Job queue-set of all processes in the system. G Ready queue-set of all processes residing in main memory, ready and waiting to execute. g Device queues -set of processes waiting for an lo device Process migration between the various queues Gao Haichang, Software School, Xidian University 18
Operating Systems Gao Haichang , Software School, Xidian University 18 Process Scheduling Queues Job queue – set of all processes in the system. Ready queue – set of all processes residing in main memory, ready and waiting to execute. Device queues – set of processes waiting for an I/O device. Process migration between the various queues. 进程调度队列
Operating Systems iX Implementation of Processes g To implement the process model, the operating system maintains a table, called the process table(process control blocks, PCB). e This entry contains information about the process state, its program counter, stack pointer, memory allocation, the status of its open files, its accounting and scheduling information, and everything else about the process that must be saved when the process is switched from running to ready or blocked state so that it can be restarted later as if it had never been stopped Gao Haichang, Software School, Xidian University 19
Operating Systems Gao Haichang , Software School, Xidian University 19 Implementation of Processes To implement the process model, the operating system maintains a table, called the process table (process control blocks, PCB). This entry contains information about the process’ state, its program counter, stack pointer, memory allocation, the status of its open files, its accounting and scheduling information, and everything else about the process that must be saved when the process is switched from running to ready or blocked state so that it can be restarted later as if it had never been stopped
Operating Systems iA Implementation of Processes(2) Process management Memory management File management Registers Pointer to text segment Root directory Program counter Pointer to data segment Working directory Program status word Pointer to stack segment File descriptors Stack pointer User ID Process state Group ID Priority Scheduling parameters Process ID Parent process Process group Signals Time when process started CPU time used Children's CPU time Time of next alarm Fields of a process table enti Gao Haichang, Software School, Xidian University 20
Operating Systems Gao Haichang , Software School, Xidian University 20 Implementation of Processes (2) Fields of a process table entry
Operating Systems Process Control Block(PCB) Information associated with each process. g Process state 进程状态 e Program counter 程序计数器 G CPU registers CPU寄存器 e CPU scheduling information CPU调度信息 Memory- management information内存管理信息 g Accounting information 计账信息 G vo status information IO状态信息 Gao Haichang, Software School, Xidian University
Operating Systems Gao Haichang , Software School, Xidian University 21 Process Control Block (PCB) Information associated with each process. Process state 进程状态 Program counter 程序计数器 CPU registers CPU寄存器 CPU scheduling information CPU调度信息 Memory-management information 内存管理信息 Accounting information 计账信息 I/O status information I/O状态信息
Operating Systems Processes and Threads 21 Processes(进程) 22 Threads(线程) 23 Scheduling(调度) 24 Interprocess communication(进程间通信) 2. Classical IPc problems(经典IPC问题) Gao Haichang, Software School, Xidian University
Operating Systems Gao Haichang , Software School, Xidian University 22 2.1 Processes (进程) 2.2 Threads(线程) 2.3 Scheduling(调度) 2.4 Interprocess communication(进程间通信) 2.5 Classical IPC problems (经典IPC问题) Processes and Threads