|
Boost : |
From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-09-17 19:30:46
----- Original Message -----
From: "William Kempf" <williamkempf_at_[hidden]>
> >Sorry, I don't understand something. Could you please explain the
> >difference between "thread blocking" and what happens when
> > >condition::wait()
> >causes the calling thread to block? And also how this distinction is
> >relevant to users of condition?
>
> The *primary* action of condition::wait() is for the condition to wait to
be
> signaled (in another thread), which (as a side effect) causes the current
> thread to block. Can you explain how condition::wait() is any different
> from any other blocking operation in this regard? If not, how are the
> distinction for the other blocking operations relevant to the users?
As counterintuitive as I find this way of thinking, I'm willing to assume
you understand threads at a deeper level than I do, and when I get to your
level I'll see that it all makes sense. So, if we make that assumption, I
would want to see something more like condition::get() than
condition::wait(). The condition doesn't wait any more than a blocking read
from a file causes the file to wait. I don't really see any difference
between blocking and waiting, but if you insist that there is a difference,
it seems like we should abolish the term "wait". If anything, I think it
will confuse people.
-Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk