Process Concept
Process state
- new
- ready
- running
- waiting
- terminated
Process Control Block (PCB)
- process state
- process number
- program counter
- registers
- memory limits
- list of open file
Process scheduler
- Job queue -- all in system
- Ready queue -- all in main memory
- Device queue -- waiting for I/O
- short-term scheduler(CPU scheduler) -- to cpu
- long-term scheduler(Job scheduler)--to ready queue
- I/O-bound process(I/O greater than coumpuation) --many short cpu bursts
- CPU-bound process(more on computation) --few long cpu bursts
- Context Switch -- whec switch to another process, state of old process saved, state of new process load
Creat Prcoess
- parent create children, forming tree
Process Termination
- executes last statement, ask system to delete using
exit()
system calls, return status from child to parent (via wait()
)
Comunication models
- Message passing
- shared memory
Interprocess communication -- message passing
- IPC facility provides:
- send(message)
- receive(message)
DIrect Communication
- Process must name each other explicitly:
send(P, message)
//send to P
receive(Q, message)
//receive from Q
Indirect Communication
- create a new mailbox(port)
- send and receive through mailbox (lab, virtual machine communication, SDN)
- send(A, message)
- receive(A, message)
- destroy mailbox