[cs33211] CS33211 Single mutex solution?

Mikhail Nesterenko mikhail at cs.kent.edu
Thu Oct 11 15:53:55 EDT 2012


> 
> You said single mutex solutions are not possible because cars must enter
> the zone at the same time if they are travelling in both directions.
> However, a single mutex solution is acceptable for the readers/writers
> problem when multiple readers wish to read at the same time. How can this
> be?

What I might have said is that a thread (a car or a pedestrian) cannot
hold an exclusive lock (a mutex) inside the construction zone because
there can be multiple cars or pedestrians crossing the construction
zone at the same time.


> Also, in the real world, drivers will never arrive at an intersection at
> exactly the same time. Someone will arrive first and the other will arrive
> immediately after.

Well, sure. In your program, if two cars arrive in the same, you can
process them in any order.


Thanks,
-- 
Mikhail


More information about the cs33211 mailing list