Interface Condition - bind/unbind ?!

Alexander Terekhov TEREKHOV@de.ibm.com
Wed, 30 Jan 2002 18:59:24 +0100


G'Day,

Are there any reasons why there is no interface to bind/unbind
a condition to(another)/from a corresponding lock object?

http://groups.google.com/groups?as_umsgid=slrn9ehssd.hq.kaz%40cafe.net

"For example, a condition variable could be placed in some request
structure.
 The request structure is enqueued somewhere in a service provider, which
 contains a mutex. The mutex and condition are used together to do the
condition
 wait for the request completion.  After the request completes, the same
request
 object is then reused, this time with a completely different service
provider
 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
waiting
 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
would
 have to be reinitialized each time to bind to the new mutex, which is
 overhead."

regards,
alexander.