What is process synchronization?
Process synchronization involves managing processes that share the same memory space. It maintains consistency of data by allowing only one process to make changes to the shared memory at one time.
What is the race condition?
A race condition is where multiple processes access and manipulate the same data simultaneously and the outcome of the execution depends on the order in which the access takes place.
What is the critical section problem?
The critical section problem is to make sure that only one process should be in a critical section at a time.
The critical section problem is to design a protocol that processes can use to synchronize their activity so as to cooperatively share data.
What is the critical section in a process?
The critical section is a segment of code in a process where the process may be accessing and updating data that is shared with at least one other process. When one process is executing its critical section, no other process is allowed to execute it’s critical section.
What is the structure of a process?
What are the three requirements a solution to the critical section problem must satisfy?
What Peterson’s solution?
Peterson’s solution is a solution to the critical section problem. It is restricted to two processes that alternate execution between their critical sections and remainder sections. It requires that both processes share two properties which are a Boolean flag and int Turn. When a process is executing in a critical section, then the other process executes the rest of the code.
What are the limitations to Peterson’s solution?
The limitations to Peterson’s solution are:
1. It involves busy waiting (process is waiting for condition to be satisfied in a tight loop)
2. Not guaranteed to work on modern architectures
3. May give inconsistent or unexpected results for multithreaded applications
What is the mutex lock?
The mutex lock is a software tool which solves the critical section problem. The mutex lock is used to protect critical sections and thus prevent race conditions. A process must acquire the lock before entering a critical section using the acquire() function, and release the lock when it exits the critical section using the release() function
What is a semaphore?
Semaphore is an integer variable S, that is initialized with the number of resources present in the system and is used for process synchronization. It uses two functions to change the value of S those being wait() and signal(). Only one process can change the value of S at a particular time.
What are the two types of Sempahore?
What is a deadlock?
A deadlock is a situation where two or more processes are waiting for each other.
What are the four conditions that when held simultaneously can lead to a deadlock?
What are the 3 methods of handling deadlocks?
What are the methods of deadlock prevention?
What are the 3 methods of deadlock avoidance?