| Lab | Assigned | Design Due (In class) 10 AM |
Implement (In Lab) Wednesday |
Demo (In Lab) Wednesday |
Lab Due (In lab) Wednesday |
|||||
|---|---|---|---|---|---|---|---|---|---|---|
| 11 | Feb | 12 | Feb | 19 | Feb | 19 | Feb | |||
JPanel)
Runnable
- Lab.java
- Startup.java (tests your stuff)
- LockInvokable.java
- Scribbler.java
Room. Look for the spots in the
code where you must provide the implementation.
Note: Think hard about what object the LockPub
instances (4 of them per room) are trying to guard. It's not
the north, south, east, west objects!
Once this class emits its PCS signals,
the test code in Startup will report it as such.
LockPub. The only method you have
to implement is lockInvoke. That method must
go through the process of requesting the lock (on o, not
on itself), acquiring the lock, running the Runnable, and
releasing the lock. See the JavaDoc for the signals that need
to be emitted along the way.
Once it emits its PCS signals,
the testing code will show when locks are requested, granted, and
become available again.
DoubleLock.
Here again, the only method you implement is lockInvoke.
Get a lock on o1, using its lockInvoke
method, which should get a lock on o2 similarly, and then
with both locks in hand, run the Runnable
Testing code should now work
on double locks. Note that the locks of a double lock are obtained
in a random order; you should see this in your output.