Interface Condition - bind/unbind ?!
Wed, 30 Jan 2002 18:59:24 +0100
Are there any reasons why there is no interface to bind/unbind
a condition to(another)/from a corresponding lock object?
"For example, a condition variable could be placed in some request
The request structure is enqueued somewhere in a service provider, which
contains a mutex. The mutex and condition are used together to do the
wait for the request completion. After the request completes, the same
object is then reused, this time with a completely different service
with a different mutex.
In this scenario, the wait and signal operation are always with respect
to the same mutex. It never happens that the request is signaled in
the context of one service provider, while enqueued in another.
Perhaps more to the point, in that scenario, you never have two or more
threads which use the condition with a different mutex at the same time!
Your API proposal would rule out this usage; or, at least, the condition
have to be reinitialized each time to bind to the new mutex, which is