Describe a way to achieve mutual exclusion among a certain number (more than two) of threads in a purely algorithmic manner. Write the pseudocode for what each thread needs to do to achieve mutual exclusion in this manner. Note that your solution must be purely algorithmic. In other words, you cannot depend on any special CPU hardware features (e.g. interrupt disabling or test-and-set instructions) or use OS provided tools like a semaphore.
Describe a way to achieve mutual exclusion among a certain number (more than two) of threads in a
purely
exclusion in this manner. Note that your solution must be purely algorithmic. In other words, you
cannot depend on any special CPU hardware features (e.g. interrupt disabling or test-and-set
instructions) or use OS provided tools like a semaphore.
ALGORITHM: -
A concurrency management characteristic called mutual exclusion might be used to prevent race problems. It is necessary for only one method to execute the critical section at any given time, such that one cannot enter its crucial section while another synchronous method is already gifting or executing it.
Step by step
Solved in 2 steps