FIFO

FIFO

FIFO is an acronym for First In, First Out, an abstraction in ways of organizing and manipulation of data relative to time and prioritization. This expression describes the principle of a queue processing technique or servicing conflicting demands by ordering process by first-come, first-served (FCFS) behaviour: what comes in first is handled first, what comes in next waits until the first is finished, etc.

Thus it is analogous to the behaviour of persons queueing (or "standing in line", in common American parlance), where the persons leave the queue in the order they arrive, or waiting one's turn at a traffic control signal. FCFS is also the shorthand name (see Jargon and acronym) for the FIFO operating system scheduling algorithm, which gives every process CPU time in the order they come. In the broader sense, the abstraction LIFO, or Last-In-First-Out is the opposite of the abstraction FIFO organization, the difference perhaps is clearest with considering the less commonly used synonym of LIFO, FILO—meaning First-In-Last-Out. In essence, both are specific cases of a more generalized list (which could be accessed anywhere). The difference is not in the list (data), but in the rules for accessing the content. One sub-type adds to one end, and takes off from the other, its opposite takes and puts things only on one end.cite book
last=Kruse|First=Robert L.|title=Data Structures & Program Design (second edition)|edition=second (hc) textbook
origdate=1984|date=1987|others=Joan L. Stone, Kenny Beck, Ed O'Dougherty (production process staff workers)
publisher=Prentice-Hall, Inc. div. of Simon & Schuster|location=Englewood Cliffs, New Jersey 07632
isbn= ISBN 0-13-195884-4|quote="The definition of a finite sequence immediately makes it possible for us to attempt a definition of a list: A 'list' of terms of type T is simply a finite sequence of elements of the set T. ... The only difference among stacks and queues and more general lists is the operations by which changes or accesses can be made to the list."|pages= p. 150|
]

A priority queue is a variation on the queue which does not qualify for the name FIFO, because it is not accurately descriptive of that data structure's behavior. Queueing theory encompasses the more general concept of queue, as well as interactions between strict-FIFO queues.

People

*For queues of people, "see" queue area.

Computer science

Data structure

In computer science this term refers to the way data stored in a queue is processed. Each item in the queue is stored in a queue ("simpliciter") data structure. The first data to be added to the queue will be the first data to be removed, then processing proceeds sequentially in the same order. This is typical behavior for a queue, but see also the LIFO and stack algorithms.

A typical data structure will look likestruct fifo_node { struct fifo_node *next; value_type value;};

class fifo{ fifo_node *front; fifo_node *back; fifo_node *dequeue(void) { fifo_node *tmp = front; front = front->next; return tmp; } queue(value) { fifo_node *tempNode = new fifo_node; tempNode->value = value; back->next = tempNode; back = tempNode; (For information on the abstract data structure, see Queue. For details of a common implementation, see Circular buffer.)

Popular Unix systems include a sys/queue.h C/C++ header file which provides macros usable by applications which need to create FIFO queues.

Head or tail first

Authors and users of FIFO queue software should consider carefully the use of the terms "head" and "tail" to refer to the two ends of the queue. To many people, items should enter a queue at the tail, remain in the queue until they reach the head and leave the queue from there. This point of view is justified by analogy with queues of people waiting for some kind of service and parallels the use of "front" and "back" in the above example. Other people, however, believe that you enter a queue at the head and leave at the tail, in the manner of food passing through a snake. Queues written in that way appear in places that might be considered authoritative, such as the GNU/Linux operating system, making the point of view hard to dismiss however repugnant you find the idea of getting your data from a snake's rear-end.

Pipes

In computing environments that support the pipes and filters model for interprocess communication, a FIFO is another name for a named pipe.

Disk Scheduling

Disk controllers can use the FIFO as a disk scheduling algorithm to determine the order to service disk I/O requests.

Communications and networking

Communications bridges, switches and routers used in Computer networks use FIFOs to hold data packets in route to their next destination. Typically at least one FIFO structure is used per network connection. Some devices feature multiple FIFOs for simultaneously and independently queuing different types of information.

Electronics

FIFOs are used commonly in electronic circuits for buffering and flow control which is from hardware to software. In hardware form a FIFO primarily consists of a set of read and write pointers, storage and control logic. Storage may be SRAM, flip-flops, latches or any other suitable form of storage. For FIFOs of non-trivial size a dual-port SRAM is usually used where one port is used for writing and the other is used for reading.....

A synchronous FIFO is a FIFO where the same clock is used for both reading and writing. An asynchronous FIFO uses different clocks for reading and writing. Asynchronous FIFOs introduce metastability issues......A common implementation of an asynchronous FIFO uses a Gray code (or any unit distance code) for the read and write pointers to ensure reliable flag generation. One further note concerning flag generation is that one must necessarily use pointer arithmetic to generate flags for asynchronous FIFO implementations. Conversely, one may use either a "leaky bucket" approach or pointer arithmetic to generate flags in synchronous FIFO implementations.

Examples of FIFO status flags include: full, empty, almost full, or almost empty.........

The first known FIFO implemented in electronics is done by Peter Alfke in 1969 at Fairchild Semiconductors. Peter Alfke is now a Director at Xilinx......

FIFO FULL/EMPTY

In hardware FIFO is used for synchronization purposes. It is often implemented as a circular queue, and thus has two pointers:
#Read Pointer/Read Address Register
#Write Pointer/Write Address Register

Read and write addresses are initially both at the first memory location and the FIFO queue is Empty.;FIFO Empty: When read address register reaches to write address register, the FIFO triggers the Empty signal.;FIFO FULL: When write address register reaches to read address register, the FIFO triggers the FULL signal.

See also

* LIFO (Last in, first out)
* GIGO (Garbage In, Garbage Out)

Notes and references


* [http://www.sunburst-design.com/papers/CummingsSNUG2002SJ_FIFO2.pdf Cummings et al., Simulation and Synthesis Techniques for Asynchronous FIFO Design with Asynchronous Pointer Comparisons, SNUG San Jose 2002]


Wikimedia Foundation. 2010.

Игры ⚽ Поможем решить контрольную работу

Look at other dictionaries:

  • FIFO — Saltar a navegación, búsqueda FIFO es el acrónimo inglés de First In, First Out (primero en entrar, primero en salir). Un sinónimo de FIFO es FCFS, acrónimo inglés de First Come First Served ( primero en llegar, primero en ser servido). Es un… …   Wikipedia Español

  • FIFO — / fī ˌfō/ abbrfirst in, first out Merriam Webster’s Dictionary of Law. Merriam Webster. 1996. FIFO abbrv. First in, first o …   Law dictionary

  • Fifo —   [Abkürzung für englisch first in, first out »als Erstes hinein, als Erstes heraus«], FIFO, Form der Datenbewegung in speziellen schieberegisterähnlichen Datenspeichern (Fifo Speicher), bei der die Daten in der gleichen Reihenfolge verarbeitet… …   Universal-Lexikon

  • FIFO — (f[imac] f[=o]), a. [acronym, First In First Out.] 1. (accounting) an accounting method in which goods in inventory are valued at the price of the most recent acquisition of each type of goods, and those used up from inventory are valued at the… …   The Collaborative International Dictionary of English

  • FIFO — es el acrónimo inglés de First In, First Out (Primero en entrar, primero en salir). Es un algoritmo utilizado en estructuras de datos, contabilidad de costes y teoría de colas. Guarda analogía con las personas que esperan en una cola y van siendo …   Enciclopedia Universal

  • FIFO —   [Abk. für First in, First out, dt. »als Erster hinein als Erster heraus«], ein Prinzip der Speicherverwaltung, das bei der Warteschlange angewandt wird. Dabei werden die im Speicher eingehenden Elemente in der Reihenfolge ausgegeben, in der sie …   Universal-Lexikon

  • FIFO — First in, first out (буквально: первый внутрь, первый наружу ) метод оценки и учета материальных запасов компании или портфеля ценных бумаг в порядке их поступления (покупки); подразумевается, что купленные раньше запасы или бумаги потребляются… …   Словарь бизнес-терминов

  • FIFO — (First In First Out) system in which the first item stored is the first item retrieved (Computers); inventory method for valuing merchandise …   English contemporary dictionary

  • FIFO — ☆ FIFO [fī′fō΄ ] n. [f(irst) i(n,) f(irst) o(ut)] a method of valuing inventories in which items sold or used are priced at the cost of earliest acquisitions and those remaining are valued at the cost of most recent acquisitions: cf. LIFO …   English World dictionary

  • FIFO — У этого термина существуют и другие значения, см. FIFO и LIFO. FIFO планировщик проц …   Википедия

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”