Chapter 2 Processes and Scheduling
Chapter 2 Processes and Scheduling (I)
Contents 8 Foundation Process Description and control Implement: Mutual Exclusion and synchronization ☆ Avoidance: Deadlock(死锁) and Hungry(饥饿 ☆ Solution: Several classical(经典) Problems ☆ About: Process communications ☆ Policy: Process scheduling ROCESSES AND SCHEDULING
PROCESSES AND SCHEDULING Contents ❖ Foundation:Process Description and Control ❖ Implement: Mutual Exclusion and Synchronization ❖ Avoidance: Deadlock(死锁) and Hungry(饥饿) ❖ Solution: Several Classical(经典) Problems ❖ About: Process Communications ❖ Policy: Process scheduling
Process Description and Control (p101) Concurrence(vs parallel) execution of processes ( supplement(补充)) Process states and transition 8 Process description (PCB) Process control (Primitive/Atomic) ROCESSES AND SCHEDULING
PROCESSES AND SCHEDULING Process Description and Control (p101) ❖Concurrence (vs.parallel) execution of processes (supplement(补充)) ❖Process states and transition ❖Process description(PCB) ❖Process control(Primitive/Atomic)
Serial Execution of program Serial execution characteristics Sequence(顺序)、 isolate(独立 recurrence(再现) Concurrence execution characteristics discontinuity, no-isoloate, no-recurrence ☆ Bernstein condition R(D和P2WPnR(PWPD∩WP2)= PROCESSES AND SCHEDULING
PROCESSES AND SCHEDULING Serial Execution of Program ❖ Serial execution characteristics ٭ Sequence ( 顺 序 ) 、 isolate ( 独 立 ) 、 recurrence(再现) ❖Concurrence execution characteristics ٭ discontinuity、no-isoloate、no-recurrence ❖Bernstein condition R(P1) ∩W(P2)∪W(P1) ∩R(P2)∪W(P1) ∩W(P2) = {Φ}
Some Problems for Process Management (p101) ☆ How to dispatch(分派) CPU to multi-processes o How to allocate resource to multi-processes and avoid deadlock and hungry o How to implement the process communication ROCESSES AND SCHEDULING
PROCESSES AND SCHEDULING Some Problems for Process Management(p101) ❖How to dispatch(分派) CPU to multi-processes ❖How to allocate resource to multi-processes and avoid deadlock and hungry ❖How to implement the process communication
Process Concept(p60) 令 A program in execution ☆The“ animated spirit” of a program o The entity that can be assigned to and executed on a processor PROCESSES AND SCHEDULING
PROCESSES AND SCHEDULING Process Concept(p60) ❖ A program in execution ❖ The “animated spirit” of a program ❖ The entity that can be assigned to and executed on a processor
rocess Characteristics(Supplement) Dynamic: create->dispatch->request 1o-> redispatch(重分派)>ext ☆ Concurrence Independence: Each process does not feel the existence of other processes Discontinuity: PROCESSES AND SCHEDULING
PROCESSES AND SCHEDULING Process Characteristics(Supplement) ❖Dynamic: create->dispatch->request I/O-> redispatch(重分派)->exit ❖Concurrence: ❖Independence:Each process does not feel the existence of other processes. ❖Discontinuity:
Architecture of Process (p120) ☆ User data and progran ☆ System stack Pcb Process Control block PROCESSES AND SCHEDULING
PROCESSES AND SCHEDULING Architecture of Process(p120) ❖User data and program ❖System stack ❖PCB,Process Control Block
Process States Concurrence execution of processes ☆ States of processes(2- states、5- states) PROCESSES AND SCHEDULING
PROCESSES AND SCHEDULING Process States ❖Concurrence execution of processes ❖States of processes(2-states、5-states)
Example of Concurrence Execution(p102) An example Three processes are fully loaded in main memory. A small dispatcher program that moves the processor from one process to another The first 12 instruction executed in processes a and c s Process b executes four instructions and the fourth nstruction invokes(激发) an 1O operation for which the process must wait. PROCESSES AND SCHEDULING
PROCESSES AND SCHEDULING Example of Concurrence Execution(p102) An example: ٭ Three processes are fully loaded in main memory. ٭ A small dispatcher program that moves the processor from one process to another. ٭ The first 12 instruction executed in processes A and C. ٭ Process B executes four instructions and the fourth instruction invokes(激发) an I/O operation for which the process must wait