Functions Palette/Programming/Synchronization/Queue Operations: Difference between revisions
No edit summary |
Main part was taken from NI.com. Added image and additional text from/link to NI.com knowledge base article on queues from which the original wording came. |
||
Line 1: | Line 1: | ||
==Location in palette== | ==Location in palette== | ||
Functions >> Synchronization >> Queue Operations | |||
[[File:QueuePalette.png|thumb|Queue Operations Palette]] | |||
==Concept== | ==Concept== | ||
A queue maintains a first in/first out order of data items. For instance, the customers waiting in line at a fast food restaurant are in a queue. A queue is useful in producer/consumer situations, where one portion of code is creating data to be used by another portion. The advantage of using a queue is that the producer and consumer rates do not have to be identical. If consumption is slower than production, the queue will become full and the producer code will be forced to wait until the consumer has dequeued an element before a new element can be queued up. | (From [http://www.ni.com NI.com]) | ||
A queue maintains a first in/first out (FIFO) order of data items. For instance, the customers waiting in line at a fast food restaurant are in a queue. | |||
A queue is useful in producer/consumer situations, where one portion of code is creating data to be used by another portion. The advantage of using a queue is that the producer and consumer rates do not have to be identical. If consumption is slower than production, the queue will become full and the producer code will be forced to wait until the consumer has dequeued an element before a new element can be queued up. | |||
Unlike an array, it is not possible to randomly access elements in a queue. It is strictly a buffer that provides you the ability to enqueue (add/insert) and dequeue (subtract/remove) elements. The only way to view all the elements in a queue is to dequeue them one by one. You cannot perform data manipulation to all the elements in a queue either. | |||
==Example use cases== | ==Example use cases== | ||
[[Queued_State_Machine|Queued State Machines]] (Also known as Queue Driven State Machines, or QDSMs). | |||
==External Links== | |||
#[https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P7OfSAK&l=en-US NI.com - What Is a Queue] | |||
[[ | [[Category:Synchronization]] | ||
[[Category:Synchronization]] |
Revision as of 17:33, 21 February 2019
Location in palette
Functions >> Synchronization >> Queue Operations

Concept
(From NI.com)
A queue maintains a first in/first out (FIFO) order of data items. For instance, the customers waiting in line at a fast food restaurant are in a queue.
A queue is useful in producer/consumer situations, where one portion of code is creating data to be used by another portion. The advantage of using a queue is that the producer and consumer rates do not have to be identical. If consumption is slower than production, the queue will become full and the producer code will be forced to wait until the consumer has dequeued an element before a new element can be queued up.
Unlike an array, it is not possible to randomly access elements in a queue. It is strictly a buffer that provides you the ability to enqueue (add/insert) and dequeue (subtract/remove) elements. The only way to view all the elements in a queue is to dequeue them one by one. You cannot perform data manipulation to all the elements in a queue either.
Example use cases
Queued State Machines (Also known as Queue Driven State Machines, or QDSMs).