Java Reference
In-Depth Information
In this example, I've asked you to complete a task. You saw that you could contribute a part of
the task and then ask a friend to do the rest. You know that your friend's task is just like the original
task, but it is smaller. You also know that when your friend completes this smaller task, your job
will be done. What is missing from the process just described is the signal that each friend gives to
the previous person at the completion of a task.
FIGURE 7-1
Counting down from 10
10 !
You count down
from 9.
9 !
You count down
from 8.
8 !
You count down
from 7.
2 !
You count down
from 1.
1 !
I'm done
Several friends later...
I'm done
I'm done.
Several friends later...
I'm done
too.
To provide this signal, when you count down from 10, I need you to tell me when you are
done. I don't care how—or who—does the job, as long as you tell me when it is done. I can take a
nap until I hear from you. Likewise, when you ask a friend to count down from 9, you do not care
how your friend finishes the job. You just want to know when it is done so you can tell me that you
are done. You can take a nap while you are waiting.
Search WWH ::




Custom Search