MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ process_token()

void MayaFlux::Vruta::TaskScheduler::process_token ( ProcessingToken  token,
uint64_t  processing_units = 1 
)

Process all tasks for a specific processing domain.

Parameters
tokenProcessing domain to advance
processing_unitsNumber of units to process (samples/frames/etc.)

Advances the appropriate clock and processes all tasks that are ready to execute in the specified domain. This is the main entry point for backend-specific processing loops.

Definition at line 103 of file Scheduler.cpp.

104{
105 auto processor_it = m_token_processors.find(token);
106 if (processor_it != m_token_processors.end()) {
107 auto tasks = get_tasks_for_token(token);
108 processor_it->second(tasks, processing_units);
109 } else {
110 process_default(token, processing_units);
111 }
112
113 static uint64_t cleanup_counter = 0;
114 if (++cleanup_counter % (m_cleanup_threshold * 2) == 0) {
116 }
117}
static MayaFlux::Nodes::ProcessingToken token
Definition Timers.cpp:8
void cleanup_completed_tasks()
Clean up completed tasks in a domain.
uint32_t m_cleanup_threshold
Threshold for task cleanup.
std::vector< std::shared_ptr< Routine > > get_tasks_for_token(ProcessingToken token) const
Get all tasks for a specific processing domain.
Definition Scheduler.cpp:92
std::unordered_map< ProcessingToken, token_processing_func_t > m_token_processors
Custom processors for specific domains.
void process_default(ProcessingToken token, uint64_t processing_units)
Process tasks in a specific domain with default algorithm.

References cleanup_completed_tasks(), get_tasks_for_token(), m_cleanup_threshold, m_token_processors, process_default(), and token.

Referenced by process_all_tokens().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: