| 23 | struct RunThread |
| 24 | { |
| 25 | void operator()(exec::static_thread_pool& pool, |
| 26 | std::size_t total_scheds, |
| 27 | std::size_t tid, |
| 28 | std::barrier<>& barrier, |
| 29 | #ifndef STDEXEC_NO_MONOTONIC_BUFFER_RESOURCE |
| 30 | std::span<char> buffer, |
| 31 | #endif |
| 32 | std::atomic<bool>& stop, |
| 33 | exec::numa_policy numa) |
| 34 | { |
| 35 | int numa_node = numa.thread_index_to_node(tid); |
| 36 | void(numa.bind_to_node(numa_node)); |
| 37 | while (true) |
| 38 | { |
| 39 | barrier.arrive_and_wait(); |
| 40 | if (stop.load()) |
| 41 | { |
| 42 | break; |
| 43 | } |
| 44 | #ifndef STDEXEC_NO_MONOTONIC_BUFFER_RESOURCE |
| 45 | pmr::monotonic_buffer_resource rsrc{buffer.data(), buffer.size()}; |
| 46 | pmr::polymorphic_allocator<char> alloc{&rsrc}; |
| 47 | auto env = stdexec::prop{stdexec::get_allocator, alloc}; |
| 48 | auto [start, end] = exec::_pool_::even_share(total_scheds, tid, pool.available_parallelism()); |
| 49 | auto iterate = exec::schedule_all(pool, std::views::iota(start, end)) |
| 50 | | exec::ignore_all_values() | stdexec::write_env(env); |
| 51 | #else |
| 52 | auto [start, end] = exec::_pool_::even_share(total_scheds, tid, pool.available_parallelism()); |
| 53 | auto iterate = exec::schedule_all(pool, std::views::iota(start, end)) |
| 54 | | exec::ignore_all_values(); |
| 55 | #endif |
| 56 | stdexec::sync_wait(iterate); |
| 57 | barrier.arrive_and_wait(); |
| 58 | } |
| 59 | } |
| 60 | }; |
| 61 | |
| 62 | struct my_numa_distribution : public exec::default_numa_policy |
nothing calls this directly
no test coverage detected