Search waiting | Matsusada Precision

Searching...

Technical Terms

The Queue is a fundamental linear data structure that follows a specific principle: First-In, First-Out (FIFO). This principle dictates that the first element added to the queue will be the first one to be removed. It operates just like a queue of people waiting in line at a checkout counter; the first person to get in line is the first person to be served. A queue has two primary operations: enqueue, which adds an element to the rear (end) of the queue, and dequeue, which removes an element from the front (head) of the queue. This structure is very useful in programming for managing tasks or data that need to be processed in the order they were received.

For example, an operating system uses queues to manage print jobs; documents are printed in the order they were sent to the printer. In the context of instrument control, a queue could be used to manage a sequence of commands to be sent to a programmable power supply. The control program could add a series of commands (e.g., "set voltage to 5V", "wait 1 second", "set voltage to 10V") to a queue. A separate part of the program could then pull commands from the front of the queue one by one and send them to the instrument, ensuring they are executed in the correct sequence. The opposite of a queue is a stack, which operates on a Last-In, First-Out (LIFO) principle.

Related words

Information on related articles in Technical Knowledge