Chapter 3: Processes Flashcards
Describe the 5 States of a Process.
New: 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 processor
Terminated: The process has finished termination
What is the Process Control Block(PCB)?
AKA Task Control Block
Information associated with each process.
For example, state, program counter, CPU registers, CPU scheduling information, Memory-management information, I/O status Information
How does Process Scheduling Work?
State and describe the 3 scheduling queues.
Maximizes CPU use by quickly switching processes onto CPU for time sharing. It selects among available processes for next execution on CPU.
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 all processes waiting for an I/O device
What types of Schedulers are there?
Describe them.
Long-Term Scheduler(Job scheduler) - selects which schedulers should be brought into the ready queue. Controls degree of multiprogramming. Strives for good process mix.
Short-term Scheduler(CPU scheduler) - selects which process should be executed next and allocates CPU
Medium-term Scheduler - added if degree of multiple programming needs to decrease. remove process from memory, store on disk, bring back to continue, SWAPPING!
What is Context Switching?
Saves the state of the old process and loads the state of the new process.
Describe the process of creating a process.
How is it identified?
Parent process create children processes, which, in turn create other processes, forming a tree of processes.
Process identified and managed via a process identifier(pid)
How are processes terminated and for what reasons?
Executes last statement.
Parent terminates child execution because child exceeded allocated resources, task assigned to child no longer required, or parent is exiting.
Waiting for termination, returning pid.
No parent waiting, terminated process a zombie.
Parent terminated, processes are orphans.
Why do Cooperating processes need interprocess communication(IPC)? What are the to models of OPC?
Name 4 advantages of process cooperation.
A cooperating process can be affected by other processes, including sharing data.
Two models are shared memory and message passing.
Information sharing
computation speed-up
Modularity
convenience
What’s Message Passing?
A mechanism for processes to communicate and to sychronize their actions. They need to establish a communication link.
Implementation Questions for Direct communication.
How are links established?
Can a link be associated with more than 2 processes?
How many links can there be between every pair of communicating processes
What is the capacity of a link?
Is the size of a message that the link can accommodate fixed or variable?
Is a link undirectional or bi-directional?
Processes name eachother explicitly. Ex. (P, message) - send a message to process P
Established automatically
A link is associated with exactly one pair of communicating processes
Between each pair there is exactly one link
The link may be undirectional, but is usually bi-directional.
Implementaion Questions for Indirect communication.
How are links established?
Can a link be associated with more than 2 processes?
How many links can there be between every pair of communicating processes
What is the capacity of a link?
Is the size of a message that the link can accommodate fixed or variable?
Is a link undirectional or bi-directional?
Messages directed and received from mailboxes.
Process can communicate only if they share a mailbox
Link established only if processes share a common mailbox
A link may be associated with may processes
Each pair of processes may share several communication links
may be unidirectional or bi-directional
mailbox sharing
How does synchronization work?
Which is synchronous and non-synchronous?
Message passing by blocking or non-blocking.
Blocking is synchronous
Non-block is asynchronous
What’s buffering?
What are the 3 implementations?
A queue of messages attached to the link
- Zero capacity sender waits for receiver
- Bounded capacity finite length of n messages sender must wait if link full
- Unbounded capacity - infinite length sender never waits
Define a Socket.
Endpoint for communication.
Concatenation of IP address and port
communication consists between pair of sockets
What are Pipes?
Name the 2 and describe them.
Act as conduit allowing two processes to communicate
Named pipes and ordinary pipes.
Named pipes are more powerful, communication id bidirectional, no parent-child relation necessary, several processes can us.
Ordincary pipes allow communication in standard producer-consumer style, producer write to one end, undirectional, require parent-child relation for process communication.