Module 7: Concurrency Control and Synchronization Flashcards
test and set lock
a hardware instruction that locks memory locations while they are being accessed by a process
race condition
the system attempts to perform two or more operations at the same time, but due to the underlying context switching and scheduling implementations by the OS, the ordering of these operations is not guaranteed. the result of the operations changes as a function of changes in ordering
semaphore
a semaphore is a kernel object with an integer value. it supports two operations: P and V, which modify the integer value
P: one of the operations of a semaphore. if the semaphore’s value is greater than zero, decrement. otherwise, wait until the value is greater than zero and then decrement. sometimes it is also called wait.
V: one of the operations of a semaphore. increment the value of the semaphore. sometimes it is also called signal or post
binary semaphore
a semaphore that saturates at an integer value of 1
counting semaphore
a semaphore that saturates as an integer value of N, for N greater than or equal to 1
waiting queue
processes or threads waiting to enter the critical section are notified or woken up when the process currently using the critical section exits. this strategy helps eliminate the need for busy waiting in the semaphore implementation
deadlock
two or more processes are waiting independently for an event that can be caused by only one of the waiting processes
monitors
a high level abstraction that provides a convenient and effective mechanism for process synchronization
only one process may be active within the monitor at a time
condition variables
a primitive with two functions: wait and signal
wait: a condition variable function called by a process that waits for a condition to be true
signal: a condition variable function that wakes up a process waiting on the condition to be true