Priority Queue

Messages are sent between Worker MHL cases via priority message queues. Unlike standard LabVIEW FIFO queues and events, the Workers message queue allows you to assign priorities to your messages, giving you more control over which messages should be processed first ahead of less important messages, helping to make your applications more deterministic and responsive.

Workers uses the same priority queue used by the LabVIEW Actor Framework, so performance and features of the queue are the same as that of the Actor Framework.

Each Worker is assigned a message queue by its Manager when the Worker is created. (Head Workers have their message queue assigned by the Setup Head Worker.vi in the Worker's Launcher VI.) Messages are dequeued by the Dequeue Message.vi at the beginning of a Worker's MHL.

Messages in the Workers message queue can be set to one of the four possible priorities in the table below.

PriorityAvailability

Critical

Internal (framework)

High

Developer (API)

Normal

Developer (API)

Low

Developer (API)

The initialization and shutdown sequences of a Workers application are sent critical priority messages internally within the framework, so that a Workers initialization and shutdown sequence will be propagated through a Worker's call-chain as fast as possible.

Through use of the Workers palette API, developers can set their messages to either High, Normal (default) or Low, depending on the message requirements.

Good to know:

The priority queue dequeues messages in the same order they are enqueued, for any given priority, avoiding the reverse ordering of dequeued messages that can potentially occur when enqueuing elements (high priority) at the opposite end of a standard FIFO queue.

Last updated