commit | 23c75ca215a1863be13ed824b94b63bb2c2b0022 | [log] [tgz] |
---|---|---|
author | Ben Clayton <bclayton@google.com> | Mon Sep 09 20:53:42 2019 +0100 |
committer | Ben Clayton <bclayton@google.com> | Mon Sep 09 20:53:42 2019 +0100 |
tree | db923e2c4d9f4882e51a31b25e02b4bd9cf0836d | |
parent | fe71eb9af17c8be5f51c37fa0e205a7b33689a0d [diff] |
Squashed 'third_party/marl/' changes from d3b8558ce..59068ee4c 59068ee4c examples/fractal.cpp: Don't use rand() 7df53dd16 Add primes example ded37ceb8 Update README.md with build instructions b80c797df CMakeLists.txt: Don't default to building tests. d89fe34b6 CMakeLists.txt: Use explicit file lists 757566df0 Update README.md 8c98371e5 Presubmits: Enable warnings-as-errors. 0025389a1 CMakeLists: Add option to treat warnings as errors eeb070293 Fix all compiler warnings git-subtree-dir: third_party/marl git-subtree-split: 59068ee4cf1f5ff5e691ff010c8d83b5f862c4fa
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
To build the unit tests and examples, type the following in your terminal:
cd <path-to-marl> mkdir build cd build cmake .. -DMARL_BUILD_EXAMPLES=1 -DMARL_BUILD_TESTS=1 make
The resulting binaries will be found in <path-to-marl>/build
Marl can be build using Visual Studio 2019's CMake integration.
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" add_subdirectory(${MARL_DIR})
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