commit | 6dd9ff1eb3ef1b677ba37d2d011a61b237d913d2 | [log] [tgz] |
---|---|---|
author | Ben Clayton <bclayton@google.com> | Fri Nov 15 16:46:36 2019 +0000 |
committer | Ben Clayton <bclayton@google.com> | Fri Nov 15 16:46:36 2019 +0000 |
tree | 1e69f39e4d14e260634169070e6efe9d3bbbad97 | |
parent | 193ce89467fb51a52866d2bf1a47fe0ef69b95d5 [diff] |
Squashed 'third_party/marl/' changes from 49e4e3141..14e4d862a 14e4d862a Scheduler: Fix issues with fiber lists a timeouts. 57f41915d SwiftShader build fixes. 791187298 Add Event::any(). ecd5ab322 Implement yields with timeouts, wait_for() / wait_until() 6ba730d94 Update README.md 8348be4f0 Implement page-based functions for Fuchsia 5e512cd0c Fix condition logic of assert in TasksOnlyScheduledOnWorkerThreads. 37ae48f40 Add marl::Event. a90725760 Update README.md (#49) git-subtree-dir: third_party/marl git-subtree-split: 14e4d862a959b831fd994a436e7c104c6fd19006
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 an exception on googletest for building the optional unit tests).
Marl contains many unit tests and examples that 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 built 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
Note: This is not an officially supported Google product