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

◆ enqueue_operation()

void MayaFlux::Nodes::RootNode::enqueue_operation ( PendingOp &&  op)
private

Queues an operation, draining on the caller's behalf when the queue is full.

Parameters
opThe operation to queue

A full queue is drained here if no processing cycle is in flight, otherwise the caller yields until the processing thread drains it.

Definition at line 15 of file RootNode.cpp.

16{
17 while (!m_pending_ops.push(std::move(op))) {
18 bool expected = false;
19 if (m_is_processing.compare_exchange_strong(expected, true,
20 std::memory_order_acquire, std::memory_order_relaxed)) {
22 m_is_processing.store(false, std::memory_order_release);
23 m_is_processing.notify_all();
24 } else {
25 std::this_thread::yield();
26 }
27 }
28}
void process_pending_operations()
Processes any pending node registration/unregistration operations.
Definition RootNode.cpp:164
Memory::PendingQueue< PendingOp, 2048 > m_pending_ops
Operations queued by any thread and applied in arrival order by the processing thread.
Definition RootNode.hpp:207
std::atomic< bool > m_is_processing
Flag indicating if the root node is currently processing nodes.
Definition RootNode.hpp:177

References m_is_processing, m_pending_ops, and process_pending_operations().

Referenced by register_node(), and unregister_node().

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