Skip to content

Commit 85d7776

Browse files
committed
Cleanup of improved PulseCountEngine. Dynamic nodes still broken.
1 parent 882b8f1 commit 85d7776

2 files changed

Lines changed: 140 additions & 355 deletions

File tree

include/react/propagation/PulseCountEngine.h

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ namespace pulsecount {
2626
using std::atomic;
2727
using std::vector;
2828

29-
using tbb::task_group;
3029
using tbb::task;
3130
using tbb::empty_task;
3231
using tbb::spin_rw_mutex;
@@ -40,6 +39,9 @@ struct Turn : public TurnBase
4039
Turn(TurnIdT id, TurnFlagsT flags);
4140
};
4241

42+
///////////////////////////////////////////////////////////////////////////////////////////////////
43+
/// Node
44+
///////////////////////////////////////////////////////////////////////////////////////////////////
4345
enum class ENodeMark
4446
{
4547
unmarked,
@@ -54,9 +56,6 @@ enum class ENodeState
5456
deferred
5557
};
5658

57-
///////////////////////////////////////////////////////////////////////////////////////////////////
58-
/// Node
59-
///////////////////////////////////////////////////////////////////////////////////////////////////
6059
class Node : public IReactiveNode
6160
{
6261
public:
@@ -84,16 +83,11 @@ class Node : public IReactiveNode
8483
ShiftMutexT ShiftMutex;
8584
NodeVector<Node> Successors;
8685

87-
ENodeState State = ENodeState::unchanged;
88-
89-
bool Visited = false;
90-
91-
atomic<int> ReachCount = 0;
92-
int ReachMax = 0;
86+
ENodeState State = ENodeState::unchanged;
9387

9488
private:
95-
atomic<int> counter_ = 0;
96-
atomic<ENodeMark> mark_ = ENodeMark::unmarked;
89+
atomic<int> counter_ = 0;
90+
atomic<ENodeMark> mark_ = ENodeMark::unmarked;
9791
};
9892

9993
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -104,7 +98,7 @@ class EngineBase : public IReactiveEngine<Node,TTurn>
10498
{
10599
public:
106100
using NodeShiftMutexT = Node::ShiftMutexT;
107-
using NodeVectorT = vector<Node*>;
101+
using NodeVectT = vector<Node*>;
108102

109103
void OnNodeAttach(Node& node, Node& parent);
110104
void OnNodeDetach(Node& node, Node& parent);
@@ -119,13 +113,8 @@ class EngineBase : public IReactiveEngine<Node,TTurn>
119113
void OnDynamicNodeDetach(Node& node, Node& parent, TTurn& turn);
120114

121115
private:
122-
void processChild(Node& node, bool update, TTurn& turn);
123-
void nudgeChildren(Node& parent, bool update, TTurn& turn);
124-
125-
vector<Node*> changedInputs_;
126-
task_group tasks_;
127-
128-
empty_task* rootTask_ = new( task::allocate_root() ) empty_task;
116+
NodeVectT changedInputs_;
117+
empty_task* rootTask_ = new(task::allocate_root()) empty_task;
129118
};
130119

131120
class BasicEngine : public EngineBase<Turn> {};

0 commit comments

Comments
 (0)