User Tools

Site Tools


futures

This is an old revision of the document!


Futures

Futures are a complex, heterogeneous feature. Each language handles them slightly differently. Most of the discussion here is for Java.

A future has 3 parties involved in the lifecycle.

  1. The Scheduler. This party (thread) usually creates the future object. The scheduler is the one that sets up the fulfillment of the future.
  2. The Fulfiller. This party does the work necessary to fill in the future results or errors. Usually this party is different from the Scheduler, but not always.
  3. The Waiter. This party (possibly multiple threads), awaits the results set by the Fulfiller.

In a typical scenario, these three parties are different threads, meaning there is a high amount of coordination between them.

futures.1783668835.txt.gz · Last modified: by carl