Terminology Flashcards
Synchronisation
Sharing of resources in careful and controlled manner
Condition Synchronisation
A gateway to a resources. A process can only proceed if some condition is true.
Mutual Exclusion
Only one process at time is allowed access to the resource
Liveness
All is well. Progress of processes is maintained.
Deadlock
A liveness failure. Multiple processes have access to a resurces each and each wants to access t that held by the other. Non one can give way and so the system locks.
Livelock
A liveness failure. A process is waiting for a condition to becme true but the condition can never become true.
Starvation
Several processes are continuously blocked from accessing a resource.
Four conditions of deadlock
- Shared resources
- Hold while waitng
- No pre-emption
- Cycle of processes holding on and waiting for each other
Pre-emption
Ability to automatically interupt a process, without requiring its cooperation, to give way to other process to carry out its task.
Lost update
Uncontrolled access to a resources when one proces makes an update and another concurrent process coming along at the wrong tme, so the update is mssed or lost.
Race condition
An outcome depends upon a particular sequence of more than one process, but there is something amiss with the sequence. Can be avoided by enforcing mutual exclusion.
Enforcing mutual exclusion
- Atomic actions
- Critical regions protected by entry and exit protocols to allow controlled access to a resource.
- Semaphores
- Monitors
Entry protocol
Provides gateway to critical region allowing one process at time.
Exit rotocol
Sends signal that a process has left critical region and Entry Protocol can safely allow another process to enter.
Semaphore
Comprised of two elements: counter (non-negative integer) and queue of processes waiting to enter critical region. semWait decrements counter causing process which called it to wait. semSignal increments counter allowing proces to proceed. Conceptually, Smaphore simpler than Monitor.