LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Queues or RT FIFOS

I try to develop an aplication under LabVIEW Real Time. I need to send data between timed loops. I used queues for this purpose.
But in the documents about data communication in RT, using RT FIFOS is adviced because of determinism. What are the difference between queues and RT FIFOS in the recpect of determinism?
0 Kudos
Message 1 of 3
(7,674 Views)
A Queue's internal implementation requires holding a mutex while doing enqueuing or dequeuing an element, so if these two operations happen at the same time from different threads, a time-critical thread could jitter.

The RT FIFO's internal implementation allows an enqueue and a dequeue operation to happen at the same time with no shared resource, so it will not introduce jitter in your system.
Message 2 of 3
(7,667 Views)
RT FIFOs also pre-allocate all the possible memory needed by the FIFO. If it is a FIFO of arrays, then you will have to specify the max number of arrays to store and the size for the arrays. This helps RT FIFOs avoid any memory allocation in your time-critical loop, which is a huge source of jitter.

Queues do not pre-allocate memory for your data, and they do not require that the data be of a fixed size. Starting in the LabVIEW 8.2 Real-Time Module, there are also new RT FIFO primitives with better performance and other new options, such as the ability to control how your RT FIFO will determine when they can read from or write to the FIFO. There are polling methods with optimal response time but increased CPU usage, and blocking methods that use minimal CPU resources, but have higher latency.
Jarrod S.
National Instruments
Message 3 of 3
(7,664 Views)