In Practical Foundation of Programming Languages
38 Futures and Speculations
A future is a computation that is performed before it is value is needed. Like a suspension, a future represents a value that is to be determined later. Unlike a suspension, a future is always evaluated, regardless of whether its value is required. In a sequential setting, futures are of little interest; a future of type τ is just an expression of type τ. In a parallel setting, however, futures are of interest because they provide a means of initiating a parallel computation whose result is not needed until later, by which time it will have been completed.
A speculation is a delayed computation whose result might be needed for the overall computation to finish. The dynamics for speculations executes suspended computations in parallel with the main thread of computation, without regard to whether the value of the speculation is needed by the main thread. If the value of the speculation is needed, then such a dynamics pays off, but if not, the effort to compute it is wasted.
Futures are work efficient in that the overall work done by a computation involving futures is no more than the work done by a sequential execution. Speculations, in contrast, are work inefficient in that speculative execution might be in vain—the overall computation may involve more steps than the work needed to compute the result. For this reason, speculation is a risky strategy for exploiting parallelism. It can make use of available resources, but perhaps only at the expense of doing more work than necessary!
38.3 Parallel Dynamics
Futures are only interesting insofar as they admit a parallel dynamics that allows the computation of the future to go ahead concurrently with some other computation. In this section, we give a parallel dynamics of futures and speculation in which the creation, execution, and synchronization of tasks is made explicit. The parallel dynamics of futures and speculations is identical, except for the termination condition. Whereas futures require that all tasks are completed before termination, speculations may be abandoned before they are completed.
Both futures and speculations are evaluated, regarless of whether their values are needed. So how are futures more efficient than speculations?
What does it mean by "futures require that all tasks are completed before termination, speculations may be abandoned before they are completed"?
I still don't understand how futures and speculations are evaluated differently.
Thanks.