Futures And Promises

Article by:
Date Published:
Last Modified:
This page is in notes format, and may not be of the same quality as other pages on this site.


Futures and promises are a way of dealing with asynchronous events in a multi-threaded environment.

Icon for futures and promises.

Icon for futures and promises.

A promise is used by the producer of the operation, and the future is used by the consumer. The producer writes a value to the promise. A future is used to read back the value, which can be done from a different thread (e.g. asynchronously).


The main problem with the C++ implementation of futures and promises is that you cannot block on more than one future at a time. This is called a lack of being able to compose futures. If you had many futures, and you didn’t know if what order they would return, you cannot do a single block on all of them. The best you can do it poll them individually in a loop, burning up processor power.


Geoffrey Hunter

Dude making stuff.

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License .

Related Content:


comments powered by Disqus