| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f4f8dc2 commit d7fa4c0
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,11 +22,14 @@ struct NSTATE { | |||
| 22 | 22 | constexpr static underlying_type JOINED_SUBFLOW = 0x80000000; | |
| 23 | 23 | ||
| 24 | 24 | // priority encoding (2 bits): 00=UNSET, 01=HIGH, 10=NORMAL, 11=LOW | |
| 25 | - constexpr static underlying_type PRIORITY_SHIFT = 26; | ||
| 26 | - constexpr static underlying_type PRIORITY_MASK = 0x0C000000; | ||
| 25 | + constexpr static underlying_type PRIORITY_SHIFT = 26; | ||
| 26 | + constexpr static underlying_type PRIORITY_MASK = 0x0C000000; | ||
| 27 | 27 | ||
| 28 | 28 | // mask to isolate state bits - non-state bits store # strong dependents | |
| 29 | 29 | constexpr static underlying_type STRONG_DEPENDENCIES_MASK = 0x03FFFFFF; | |
| 30 | + | ||
| 31 | + // mask to clear the state while preserving important bits | ||
| 32 | + constexpr static underlying_type CLEAR_MASK = PRIORITY_MASK; | ||
| 30 | 33 | }; | |
| 31 | 34 | ||
| 32 | 35 | using nstate_t = NSTATE::underlying_type; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2442,7 +2442,7 @@ inline size_t Executor::_set_up_graph(Graph& graph, Topology* tpg, NodeBase* par | |||
| 2442 | 2442 | auto node = *first; | |
| 2443 | 2443 | node->_topology = tpg; | |
| 2444 | 2444 | node->_parent = parent; | |
| 2445 | - node->_nstate &= NSTATE::PRIORITY_MASK; | ||
| 2445 | + node->_nstate &= NSTATE::CLEAR_MASK; | ||
| 2446 | 2446 | node->_estate.store(ESTATE::NONE, std::memory_order_relaxed); | |
| 2447 | 2447 | node->_set_up_join_counter(); | |
| 2448 | 2448 | node->_exception_ptr = nullptr; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -287,10 +287,8 @@ class NodeBase { | |||
| 287 | 287 | _join_counter {join_counter} { | |
| 288 | 288 | } | |
| 289 | 289 | ||
| 290 | - // encode TaskPriority (HIGH=0,NORMAL=1,LOW=2) as +1 into bits 26-27 of _nstate, | ||
| 291 | - // reserving 00 for UNSET (no priority explicitly assigned) | ||
| 292 | 290 | void _set_priority(TaskPriority p) { | |
| 293 | - nstate_t encoded = (static_cast<nstate_t>(p) + 1) << NSTATE::PRIORITY_SHIFT; | ||
| 291 | + nstate_t encoded = (static_cast<nstate_t>(p)) << NSTATE::PRIORITY_SHIFT; | ||
| 294 | 292 | _nstate = (_nstate & ~NSTATE::PRIORITY_MASK) | encoded; | |
| 295 | 293 | } | |
| 296 | 294 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,6 +1,5 @@ | |||
| 1 | 1 | #pragma once | |
| 2 | 2 | ||
| 3 | - #include <array> | ||
| 4 | 3 | #include <bit> | |
| 5 | 4 | ||
| 6 | 5 | #include "../utility/macros.hpp" | |
@@ -929,7 +928,7 @@ concept BoundedWSQLike = requires(Q& q, typename Q::value_type v) { | |||
| 929 | 928 | /** | |
| 930 | 929 | @brief default priority function for BoundedPriorityWSQ | |
| 931 | 930 | ||
| 932 | - Calls @c item->_priority_queue() on the element and returns the result as | ||
| 931 | + Calls `T::priority()` on the element and returns the result as | ||
| 933 | 932 | a @c size_t. Users may supply a custom priority function in place of this | |
| 934 | 933 | default to decouple the queue from any particular element interface. | |
| 935 | 934 | */ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments