futures::always_deferred_opt
Futures / Future options / always_deferred_opt
Defined in header <futures/future_options_args.hpp>
struct always_deferred_opt;
Future option to determine the future is always_deferred.
Description
A future that is known to always be deferred can implement a number of optimizations a regular future cannot. For instance,
- continuations can happen without the continuation list because the next future can simply hold the previous future.
- Continuations lists and the base operation state also don't need any synchronization because the task* is known to not have been launched when these primitives are being set.
- The operation state might be stored inline without any dynamic memory allocations because we can assume the calling thread will be locked when waiting for the future so the address of the operation state cannot change.
Updated on 2023-01-04