I have the following questions regarding locks
and conditions:
The implementation of condition::wait()
and condition::signal() take arguments
of type lock. Why? What structures are
these locks supposed to provide mutex for?
Are these locks merely meant to provide mutex
within wait() and signal()?
***********
I think in the consumer/producer problem
that some kind of lock will be needed for
mutex on access to the buffer. Is this the same
lock that will be passed to condition::wait()
and condition::signal()???????
***********
Are the condition variables analogous to
the condition variables defined in the book
in the description of monitors (p.195 in
the text)?
Is this a stupid question?
Any help/hints/references are appreciated.
Thanks,
-sg