Lace Documentationο
Lace is a C framework for fine-grained fork-join parallelism on multi-core computers. It uses work-stealing deques to distribute tasks across worker threads, providing scalable parallelism with low overhead.
Featuresο
β‘ Low-overhead, lock-free work-stealing
π€ Quiet when idle, quick to wake up
π Thread pinning per CPU, core, cache or NUMA node (Linux, FreeBSD, Windows)
π§΅ Workers on Laceβs threads or on the programβs own
π Low-overhead statistics per worker
β Interrupt support for coordinating all workers to a safe point (e.g. stop-the-world GC)
Lace uses a scalable double-ended queue for work-stealing. The owner thread pushes and pops tasks from its own deque in a wait-free manner. Thief threads steal from the other end in a lock-free manner. The design minimises cache line contention between workers.
Platform supportο
π§ Linux (GCC, Clang)
πͺ Windows (MSVC, MSYS2/MinGW)
π macOS (Apple Clang)
π FreeBSD (Clang)
User Guide
API Reference
- Lifecycle
lace_pin_modelace_idle_modelace_start()lace_start_external()lace_worker_enter()lace_worker_loop()lace_worker_leave()lace_stop()lace_release_memory()lace_is_running()lace_set_verbosity()lace_set_pinning()lace_set_pin_cpus()lace_set_idle_mode()lace_set_scratch_size()lace_set_scratch_band()
- Worker Context
- Task Operations
- Scratch Arena
- Statistics
- Miscellaneous
Publicationsο
If you use Lace in your research, please cite the following publications:
T. van Dijk and J.C. van de Pol (2014). Lace: Non-blocking Split Deque for Work-Stealing. In: Euro-Par 2014: Parallel Processing Workshops. LNCS 8806, Springer. doi:10.1007/978-3-319-14313-2_18
T. van Dijk (2016). Sylvan: Multi-core Decision Diagrams. PhD Thesis, University of Twente. doi:10.3990/1.9789036541602
Licenseο
Lace is licensed under the Apache License, Version 2.0.