Wildmeshing Toolkit
Loading...
Searching...
No Matches
Concurrency.hpp
1#pragma once
2
3// Drop-in replacements for the small subset of Intel TBB that wildmeshing-toolkit
4// uses, implemented on top of the C++ standard library (std::thread & friends).
5//
6// The goal is a *mechanical* migration off TBB: every `tbb::X` used in the code
7// base has a `wmtk::X` counterpart here with the same (used) API surface, so the
8// only edits required elsewhere are `#include <tbb/...>` -> this header and
9// `tbb::` -> `wmtk::`.
10//
11// Notes / intentional simplifications:
12// * Containers that used to grow concurrently (attribute / connectivity storage)
13// are NOT provided here -- they became plain std::vector, preallocated up front
14// (see TetMesh/TriMesh). `collector` here only backs the few "collect
15// results from parallel loops" sites, and is a mutex-guarded deque so that
16// references to existing elements stay valid while other threads append and so
17// that bool elements are not bit-packed (concurrent distinct-index writes stay
18// safe).
19// * enumerable_thread_specific is lock-free on the hot path: each thread keeps a
20// small thread_local list of (instance-id -> value) slots.
21
22#include "collector.hpp"
23#include "concurrent_map.hpp"
24#include "concurrent_priority_queue.hpp"
25#include "concurrent_queue.hpp"
26#include "enumerable_thread_specific.hpp"
27#include "parallel_for.hpp"
28#include "range.hpp"
29#include "serial_priority_queue.hpp"
30#include "spin_mutex.hpp"
31#include "task_group.hpp"
32#include "vertex_mutex.hpp"