Race conditions Flashcards
Explain Disabling Interrupts
Prevents the CPU from switching to another process while a process is in its critical region.
Explain Locks
Processes use locks to prevent others from accessing shared variables until the lock is released.
Explain Strict Alternation and Peterson’s Solution
These methods use shared variables or flags to control which process can enter its critical region. Peterson’s Solution allows processes to signal intent and take turns in entering their critical regions.
Explain TSL (Test and Set Lock)
A hardware-based solution that ensures only one process can access shared memory at a time, by locking the memory bus.
Explain Semaphores
A counting mechanism that allows processes to sleep while waiting for access, reducing CPU waste. Semaphores can ensure mutual exclusion (mutex) or event synchronization.