Skip to content
A hybrid thread / fiber task scheduler written in C++ 11
C++ Assembly C CMake Batchfile Shell Python
Branch: master
Clone or download
c0d1f1ed and ben-clayton aarch64: Fix saving/restoring register r29 on fiber switch
AArch64 register r29 (x29) is designated as the frame pointer and the
standard calling convention states that "A subroutine invocation must
preserve the contents of the registers r19-r29 and SP." In other words
it must be callee-saved.


This was leading to program aborts in __stack_chk_fail(), which gets
called in the function epilogue when the cookie/canary value that gets
inserted onto the stack by the -fstack-protector option no longer
matches the value that was written at the start of the function. This
gets reported as a stack corruption, but in this case it was actually
the stack frame register pointing to a different stack, which is
unlikely to contain the cookie value at the same offset.

Google bug: b/140967243
Latest commit 5f31df1 Sep 18, 2019


Marl is a hybrid thread / fiber task scheduler written in C++ 11.


Marl is a C++ 11 library that provides a fluent interface for running tasks across a number of threads.

Marl uses a combination of fibers and threads to allow efficient execution of tasks that can block, while keeping a fixed number of hardware threads.

Marl supports Windows, macOS, Linux, Fuchsia and Android (arm, aarch64, ppc64 (ELFv2), x86 and x64).

Marl has no dependencies on other libraries (with exception on googletest for building the optional unit tests).

Marl is in early development and will have breaking API changes.

More documentation and examples coming soon.

Note: This is not an officially supported Google product


Marl contains a number of unit tests and examples which can be built using CMake.

Unit tests require fetching the googletest external project, which can be done by typing the following in your terminal:

cd <path-to-marl>
git submodule update --init

Linux and macOS

To build the unit tests and examples, type the following in your terminal:

cd <path-to-marl>
mkdir build
cd build

The resulting binaries will be found in <path-to-marl>/build


Marl can be built using Visual Studio 2019's CMake integration.

Using Marl in your CMake project

You can build and link Marl using add_subdirectory() in your project's CMakeLists.txt file:

set(MARL_DIR <path-to-marl>) # example <path-to-marl>: "${CMAKE_CURRENT_SOURCE_DIR}/third_party/marl"

This will define the marl library target, which you can pass to target_link_libraries():

target_link_libraries(<target> marl) # replace <target> with the name of your project's target

You will also want to add the marl public headers to your project's include search paths so you can #include the marl headers:

target_include_directories($<target> PRIVATE "${MARL_DIR}/include") # replace <target> with the name of your project's target
You can’t perform that action at this time.