Chapter 5 Flashcards
what is a cooperating process
it can affect or be affected by other processes executing in the system
define race condition
several processes access and manipulate the same data concurrency and the outcome of the execution depends on the particular order in which the action takes place
what is a way to prevent race condition
process to be synchronized
a solution to the critical-section must satisfy what 3 requirements
- mutual exclusion
- progress
- bounded waiting
define Peterson’s solution
restricted to two processes that alternate execution between their critical sections and remainder sections
what should be used to see if a process is ready to enter its critical section
flag array
define locking
protecting critical regions through the use of locks
define mutex locks
mutual exclusion locks, simplest of synchronization tools, mutex lock has a boolean variable available whose value indicates if the lock is available or not
atomic process when lock is available
call to acquire() lock before entering a critical section, release() lock when it exits the critical section
define spinlock
the process spins while waiting for lock to become available, they are useful because context switch is not required
define busy waiting
wastes CPU cycles that could’ve been put to use by other processes
define semaphores
integer variable that is accessed through only 2 atomic operations: wait() and signal()
define counting semaphores
unrestricted domain
define binary semaphore
range between 0 and 1, behaves similarly to mutex locks
expand on the use of semaphores to count instances
- goes up when releasing a resource signal()
- goes down when using resource wait()