This library provides high level constructs for implementing algorithms that eases the use of multiple CPU cores while minimizing the contention.

The future implementaton differs in several aspects compared to the C++11/14/17 standard futures: It provides continuations and joins, which were just added in a C++17 TS. But more important this futures propagate values through the graph and not futures. This allows an easy way of creating splits. That means a single future can have multiple continuations into different directions. An other important difference is that the futures support cancellation. So if one is not anymore interested in the result of a future, then one can destroy the future without the need to wait until the future is fullfilled, as it is the case with std::future (and boost::future). An already started future will run until its end, but will not trigger any continuation. So in all these cases, all chained continuations will never be triggered. Additionally the future interface is designed in a way, that one can use build in or custom build executors.

Since one can create with futures only graphs for single use, this library provides as well channels. With these channels one can build graphs, that can be used for multiple invocations.


  • serial_queue

    An executor wrapper that causes enqueued tasks to be run serially.

    (template class)
  • task

    Class template stlab::task is a general-purpose polymorphic function wrapper. Instances of stlab::task can store, move, and invoke any Callable target – functions, lambda expressions, bind expressions, or other function objects, as well as pointers to member functions and pointers to data members.

    (template class)
  • Futures

    Futures class and related functions

  • Channels

    This library implements the channel model of interprocess communication.

  • Executors

    A collection of executors with different strategies to run tasks.


await Called on an await-process whenever a new value was received from upstream.
process Describes a process that gets executed whenever a value is passed into the channel
future::recover Creates a recoverable future on the current object.
future::then Creates a continuation on the current future.
receiver::operator| Attaches a new process to the channel.
receiver::set_ready Sets the receiver ready to receive values.
sender::operator() Sends a new value into the channel
stlab::async Run a function on a specified executor
stlab::channel Creates a pair that consists of a sender and a receiver
stlab::serial_queue An executor wrapper that causes enqueued tasks to be run serially.
stlab::executor Executor wrapper class
stlab::join Creates a future that joins all passed arguments
stlab::merge Creates a future that merges all passed arguments
stlab::package Create a packaged_task/future pair
stlab::when_all Creates a joining future
stlab::when_any Creates a future that continues on the first success of any futures passed
stlab::zip It creates a process that zips all passed arguments and returns a receiver.


  • C++14 compliant compiler (clang 3.6, gcc 5.3, Visual Studio 2015 Update 3)
  • boost 1.60.0 (optional, variant and test for executing the UnitTests)


Sean Parent, Foster Brereton, Felix Petriconi