Talk:FIFO (computing and electronics)/Archive 1

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Archive 1

Proposed merge with Queue

A merge was proposed by User:R.Koot - Shall we discuss it?

Add *Support or *Oppose and/or any comments you may have. Sign your comments with ~~~~
  • Support - Queue, FIFO and Circular Buffer all seem to be describing the same data structure - it seems reasonable to keep them in one article rather than three. But which of the three places should we move it to? And should we merge the 'accounting' and 'engineering' bits as well as the 'computer science' bits? Mike1024 16:41, 5 September 2005 (UTC)
  • Oppose for now -- they are not synonyms. FIFO is the behavior; Queue is an abstract data structure which produces that behavior; Circular buffer is a particular implementation that can be used for queues. As FIFO shows, the behavior is not limited to computer science, let alone to queues; as Queue shows, circular buffers are not the only implementation. There may be merits to doing some merging, but they have to be carefully considered. -- Antaeus Feldspar 18:20, 5 September 2005 (UTC)
  • Oppose. Agree with Antaeus Feldspar; also consider that there is an article on LIFO, so having an article on FIFO is nice symmetry. —Bkell 04:27, 6 September 2005 (UTC)
  • Oppose. I agree with Feldspar, a "queue" is a data structure, "fifo" is essentially an algorithm or behavior. Merging the two would make about as much sense as merging "function" and "function object". --DropDeadGorgias (talk) 15:34, September 6, 2005 (UTC)

At this time it seems there's no consensus to merge so I'm going to remove the proposal banner. I might add a link or two so people looking at each articles will at least know other articles exist... Mike1024 (talk/contribs) 18:06, 8 September 2005 (UTC)

I never meant a total merge, for the reasons expressed by the people who opposed the merge. I do think the articles need to be significantly tweaked to avoid redundancy. --R.Koot 17:47, 9 September 2005 (UTC)

Reverted edit stating "(that is why LIFO is usually not allowed)". This information was not referenced. Accounting practices vary between countries. Rklawton 15:34, 10 February 2006 (UTC)

It occurs to me

after THIS CHANGE, that the article has been slanted by the experience and knowledge of it's contributors without understanding the distinctions involved into one that is essentially a computing article. LIFO and FIFO are in essence Information Theory topics which are implemented in computing as stack (data structure) and queue (data structure), for computer manipulation of data. Management science and certainly accounting use of the same term suggests perhaps both these topics be rewritten to be a general Information sciences treatment and leave the computer implementations to the articles on stacks and queues!


Why is there a link to a commercial site on the page?

Why is there a link to the FIFO condiment bottle? Does that have anything to do with the content of the page? Jessecurry (talk) 07:12, 10 December 2007 (UTC)

I don't know, but I wanted to ask the same question. I'm not so familiar how to handle that, or mark it, so that this could checked by someone who has the knowledge and delete it. —Preceding unsigned comment added by 194.39.218.10 (talk) 07:55, 10 January 2008 (UTC)

FIFO is also an accounting term

The term appears to have originated significantly before 1900. As in information and systems uses, the term refers to ordering of items. However, in accounting and tax, FIFO may apply to a convention applied to determine which items are in inventory (stocks) or other goods on hand, or to the order in applying debits or credits to an account (such as payments by a customer).

In accounting and tax, this is a major topic, with cross-relations to topics related to inventory, payables, and receivables. Example cross-related topics include Cost of Goods Sold (currently a start class article), Inventory (C class in Project Business), Average cost (a high priority article in Project Economics), Activity Based Costing.

As time permits, I will attempt to enhance this article for the accounting & tax side of FIFO. If it is merged with another information systems article, then the article should be restarted from the accounting side.

Note that the cross reference to FIFO and LIFO Accounting is to something less than a stub.Oldtaxguy (talk) 01:15, 5 April 2010 (UTC)

Why not enhance the stub then? --Cybercobra (talk) 01:17, 5 April 2010 (UTC)

FIFO is also a logistics term

FIFO is also an acronym used in Logistics to describe the storage and retrieval of goods from a warehouse or other storage facility. — Preceding unsigned comment added by 109.94.137.1 (talk) 09:13, 18 September 2012 (UTC)

which is covered by the accounting term section above here, and also, of course, this all refers to the 'food safety LIFO' too. I'm comment to say I just can't believe WP directs FIFO to the the technical, highly specialized data structure usage rather than the everyday logistical usage. Everyday as in, if you have three day old milk, but your spouse bought milk today, that you use the older milk first. Logistical FIFO is a common everyday matter that should the #1 description. Always wondered how to do that on WP. -- EsotericRogue Talk 07:43, 5 December 2012 (UTC)

FIFO is also a part of food safety

FIFO can also be used to refer to food safety; i.e. the products are refilled so that the previous products (with expiration dates that are sooner than the new ones) are sold first, with the newer products being sold last. 81.71.110.38 (talk) 20:03, 11 March 2012 (UTC)

FIFO is also a term that the Grocery Industry uses in regard to product rotation even when safety isnt a concern. You always want to sell the oldest stock of an item first for economic reasons, as well as the safety reason mentioned above. 184.90.121.147 (talk) 19:34, 22 January 2013 (UTC)

Stack only LIFO?

According to Stack_(abstract_data_type) a stack must use LIFO structure, and I agree that it's more common, but the Perl programming languages provide functions for managing 'stacks', really arrays, in FIFO order using shift() and push(). Fuzziness between the terms 'stack' with 'array'? If you find stack inappropriate, please replace it with mention to data arrays. Zerohourrct (talk) 15:22, 23 September 2013 (UTC)

Name move

The name of this article has been moved, apparently without discussion, from FIFO (computing) to FIFO (computing and electronics). The wisdom of this complication escapes me. --Epipelagic (talk) 19:21, 17 February 2015 (UTC)

The code fragment is buggy

Try a simple thought experiment:

queue(1);
item = dequeue();

The front and back pointers are not connected by the queue and dequeue functions, so the sequence won't work as expected.

A possible fixed version of the functions:

  fifo_node *dequeue(void)
  {
    fifo_node *tmp = front;
    if (front == back) {
        front = back = NULL;
    } else {
        front = front->next;
    }
    return tmp;
  }
  queue(value)
  {
    fifo_node *tempNode = new fifo_node;
    tempNode->value = value;
    if (back) {
        back->next = tempNode;
        back = tempNode;
    } else {
        front = back = tempNode;
    }
  }

Note that this code is twice as long! The whole class would cover a full screen. I'm not sure such a queue implementation would fit into the article...

Ideas? —Preceding unsigned comment added by 85.66.64.180 (talk) 21:41, 8 September 2008 (UTC)

I overworked and tested the code. 217.237.27.81 (talk) 08:00, 15 February 2014 (UTC)

This code still doesn't work. I tested it with the following main.cpp:

    FIFO<int>  f;
	f.enqueue(32);
	std::cout << f.dequeue() << std::endl;
	f.enqueue(16);
	std::cout << f.dequeue() << std::endl;

With the original implementation, the test would fail on the 4th line with underflow_error. Dequeuing creates a memory leak; back is a raw pointer to a unique_ptr, so the unique_ptr isn't cleaned up by the destructor as usual. The improved implementation passes this test as expected, and also correctly throws the error when dequeuing an empty list. I changed all unique_ptrs to shared_ptrs, which will incur a small memory cost but makes the example much clearer in my opinion. Chartrekhan (talk) 09:02, 10 May 2021 (UTC)

Opening paragraph/sentence

The opening paragraph is a poorly worded and grammatically questionable sentence. Suggest rewriting it for improved grammar and readability. — Preceding unsigned comment added by 121.74.110.157 (talk) 23:49, 9 May 2022 (UTC)

Asynchronous vs synchronous FIFO?

I think the Explanation of synchronous FIFO is wrong. You can have different clocks for reading and writing. This datasheet of a synchronous FIFO says so http://www.ti.com/product/sn74v215. (84.114.33.167 (talk) 10:25, 27 May 2014 (UTC))

That depends on what you mean with "asynchronous": it can refer to "asynchronous operation" or "asynchronous design". In Simulation and Synthesis Techniques for Asynchronous FIFO Design, for example, it is used to mean "two different clocks", same as the Wikipedia article (i.e., reading is done asynchronously from writing). That TI datasheet, on the other hand, uses it to mean "not driven by a clock", which is unusual in digital design but more common in discrete components, so in that context it makes sense since it's a datasheet of a discrete component. —Cousteau (talk) 10:19, 25 July 2022 (UTC)