|
Boost : |
From: Thomas Holenstein (tholenst_at_[hidden])
Date: 2000-08-24 02:11:35
Hy,
> Another key point in this example: the classic paper only defines a
> signal() which is analogous to notify_one(). There is nothing
> analogous to notify_all().
This has, in fact a very good reason. As far as I remember, only
leaving threads are allowed to signal(). Thus, if you call signal()
your next statement MUST be return. That way, you don't have to
specify what happens if you call signal() and then change internal
state vars. Thus you surely can't have notify_all, every exiting
thread must notify itself, if necessary.
I would, in fact, provide Monitors as suggested by Hoare as good as
possible. Don't forget that other people probably now a monitor, thus
it would be easiest to use, if it is exactly like Hoare's Monitor.
Thomas
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk