Sometimes a thread must watch for two (or more) events at once. The classic example of this case
is the 'queue' thread.
Upstream threads will add data to the tail of the queue and downstream threads will remove data from the head.
These two events are completely unconnected and could occur at any time. Thus the 'queue' thread must watch
upstream and downstream simultaneously. The multi-threader shell provides special tools to enable a thread to
do this without compromising the integrity of the thread.
Another example might be a thread that is only prepared to accept data for a limited time period.
This thread must watch for incoming data but it must also pick up the timeout when it occurs. Again, the
shell provides an easy answer. After the timeout has expired the upstream thread must find another
thread that is open to continue the processing.
Back to our main page