[cs33211] Re: Project1 part 2.

Mikhail Nesterenko mikhail at cs.kent.edu
Mon Mar 9 20:37:15 EDT 2009



> 
> I think I found out how to do this, but before I get my hopes too high, we
> are to use some sort of global int to monitor how many travelers (and of
> what type) are in the section at once, and use wait to temporarily pause
> those that have to yield. When they're done, signal any other waiting
> vehicles or pedestrians (or broadcast) to use the street?

That is the idea. Maintain several global variables accessible to all
threads that keep track of cars and pedestrians currently in the
construction zone. Note that modifying these variables has to be done
inside the critical section protected by a lock.

Also note the the difference between this critical section which
should only admit a single thread and the construction zone which can
have several cars or pedestrians concurrently.

With this in mind, review the implementation of readers/writers using
locks and CVs.

Thanks,
-- 
Mikhail


More information about the cs33211 mailing list