ngscopeclient v0.2.2
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
FilterGraphExecutor Class Reference

Execution manager / scheduler for the filter graph. More...

#include <FilterGraphExecutor.h>

Public Member Functions

 FilterGraphExecutor (size_t numThreads=4)
 
void RunBlocking (const std::set< FlowGraphNode * > &nodes)
 Evaluates the filter graph, blocking until execution has completed.
 
SubmitBatch GetNextBatch ()
 Returns the next batch of filters to run.
 
std::map< FlowGraphNode *, int64_tGetRunTimes ()
 Get the run times of the most recent filter graph evaluation.
 
std::string GetName (FlowGraphNode *node)
 

Protected Member Functions

void FindConcurrentNodes (FlowGraphNode *anchor, std::set< FlowGraphNode * > &workingSet, bool &needBegin, bool &needEnd)
 
void MakeBatchForNodes (SubmitBatch &batch, std::set< FlowGraphNode * > &workingSet, bool needBegin, bool needEnd)
 
bool FindNextHopNodes (SubmitBatch &batch)
 Searches for nodes that will be eligible to run once anything in the batch has run and adds it.
 
void DoExecutorThread (size_t i)
 
void UpdateRunnable ()
 Searches m_incompleteNodes for any that are unblocked, and adds them to m_runnableNodes.
 

Static Protected Member Functions

static void ExecutorThread (FilterGraphExecutor *pThis, size_t i)
 Thread function to handle filter graph execution.
 

Protected Attributes

std::mutex m_mutex
 Mutex for access to shared state.
 
std::set< FlowGraphNode * > m_incompleteNodes
 Nodes that have not yet been updated.
 
std::set< FlowGraphNode * > m_runnableNodes
 Nodes that have no dependencies and are eligible to run now.
 
std::set< FlowGraphNode * > m_runningNodes
 Nodes that are actively being run.
 
std::vector< std::unique_ptr< std::thread > > m_threads
 Set of thread contexts.
 
std::condition_variable m_workerCvar
 Condition variable for waking up worker threads when work arrives.
 
std::mutex m_workerCvarMutex
 Mutex for access to m_workerCvar.
 
std::condition_variable m_completionCvar
 Condition variable for waking up main thread when work is complete.
 
std::mutex m_completionCvarMutex
 Mutex for access to m_completionCvar.
 
bool m_allWorkersComplete
 Indicates that all worker threads have finished executing this pass.
 
bool m_terminating
 Shutdown flag.
 
std::map< FlowGraphNode *, int64_tm_lastExecutionTime
 Performance statistics from previous execution.
 
std::map< FlowGraphNode *, int64_tm_currentExecutionTime
 Performance statistics from current execution.
 
std::mutex m_perfStatsMutex
 Mutex for updating performance statistics.
 

Detailed Description

Execution manager / scheduler for the filter graph.

Member Function Documentation

◆ FindNextHopNodes()

bool FilterGraphExecutor::FindNextHopNodes ( SubmitBatch batch)
protected

Searches for nodes that will be eligible to run once anything in the batch has run and adds it.

Assumes m_mutex is locked

Returns
True if we should keep searching for more hops, false if nothing more to do

◆ UpdateRunnable()

void FilterGraphExecutor::UpdateRunnable ( )
protected

Searches m_incompleteNodes for any that are unblocked, and adds them to m_runnableNodes.

Assumes m_mutex is locked


The documentation for this class was generated from the following files: