[cs33211] Quick question on Mutual exclusion

Mikhail Nesterenko mikhail at cs.kent.edu
Tue Oct 9 16:31:49 EDT 2012



> Dr. Nesterenko,
> 
> After doing some research on MX my under standing of
> it is as follows:
> 
> While one process executes on a shared variable, all other processes
> that need to use that shared variable (at the same time), must
> wait. When the first process has finished executing on the shared
> variable, the shared variable is then "unlocked" for the other
> processes to use, and so forth.  So, all in all, each process
> executing the shared variable excludes all others from doing so at
> the same time.
> 
> Are these the correct steps for MX?
> 

The classical definition is a critical section of code (the CS) rather
than a shared variable. That is, in each process there is a section of
code designated to be the critical section. Only one process at a time
is allowed to execute the CS. In other words, once one process enters
the CS, all other processes requesting CS access (said to be in CS
contention) have to wait. This condition is called "safety".  Once the
process leaves the CS, one of the processes in CS contention is
allowed to enter the CS. This CS entry should ensure that every
process requesting the CS is eventually allowed to do so ("liveness"
condition)

Thanks,
-- 
Mikhail


More information about the cs33211 mailing list