Boost logo

Boost Users :

From: Chris Coleman (cqc_at_[hidden])
Date: 2005-02-11 04:32:21


Hi Ben, and others.

Many thanks for taking the time to reply to the original questions, they
have proved most useful in providing me with a solution to my problem.

> Depending on why and how the thread is sleeping, it may be possible
> to interrupt such a sleep by sending the thread a signal or writing to
> a pipe.

I'm still a little confused by this last sentence. At present I have
opted for an arbitrary time on a timed wait on the condition variable
that was causing the threads to sleep. This seems to work, but
obviously there is a delay in the time the thread takes to die of up to
the length of the timed wait.

All the threads are waiting on the same condition variable, I can find
nothing in the Docs about anything else that will cause the threads to
wake while waiting on a condition variable. Notify_one is no good since
it is unspecified which thread shall be woken, and notify_all seems a
little excessive when only a specific thread needs waking. Although I
guess once woken all the other threads will do will be to see that their
living flag is still true, and that there are no tasks to process and as
such go back to sleep. Whatever solution is chosen it needs to be
highly portable.

Many Thanks again
Cheers
Chris

This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net