MayaFlux 0.1.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 101 of file Scheduler.cpp.

102{
103 auto processor_it = m_token_processors.find(token);
104 if (processor_it != m_token_processors.end()) {
105 auto tasks = get_tasks_for_token(token);
106 processor_it->second(tasks, processing_units);
107 } else {
108 process_default(token, processing_units);
109 }
110
111 static uint64_t cleanup_counter = 0;
112 if (++cleanup_counter % (m_cleanup_threshold * 2) == 0) {
114 }
115}
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:90
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: