<thread id="myt">
<echo "before sleep"/>
thread.<wait_until_time a_time=300/>
<echo "after sleep"/>
</thread>
<echo "begin"/>
thread.of.myt.<start/>
thread.<wait_until_done a_thread=thread.of.myt/>
<echo "end"/> | "end" |
Imagine that instead of just printing and waiting, our new thread
was actually a call to a web service. Also imagine that we have several
web services to call. We can create and start each call to a web service
within its own thread. They will compute in parallel using the
web and the remote server for distributed processing.
After we make such calls, we could wait_until_done for each of our
new threads. When our last call to wait_until_done returns,
all of our web services will be complete and we can process their results.
Note that it matter little time-wise how we order our calls to the web services
or how we order the waiting for them to be done. It just matters that we start each
thread before waiting for any of them.
© Copyright 2007 Clear Methods, Inc.