Is there a standard collection in .NET that implements a FIFO stack?
FIFO is an abbreviation for first in, first out. It is a method for handling data structures where the first element is processed first and the newest element is processed last.
FIFOs are created using mknod(2), mkfifo(3C), or the mknod(1M) command. They are removed using unlink(2) or the rm(1) command. FIFOs look like regular file system nodes, but are distinguished from them by a p in the first column when the ls -l command is run.
When a user process attempts to read from an empty pipe (or FIFO), the following happens: If one end of the pipe is closed, 0 is returned, indicating the end of the file. If the write side of the FIFO has closed, read(2) returns 0 to indicate the end of the file.
Using FIFO: As named pipe(FIFO) is a kind of file, we can use all the system calls associated with it i.e. open, read, write, close. Example Programs to illustrate the named pipe: There are two programs that use the same FIFO. Program 1 writes first, then reads. The program 2 reads first, then writes.
FIFO means first-in-first-out. The data structure you're looking for is called a Queue.
FIFO means first in first out. This is as opposed to LIFO (or FILO as lucero pointed out). which is last in first out.
A link comparing queues, stacks, and hashtables.
You want to use a queue object for FIFO operations:
http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=66
MSDN link on queues
And a stack is used for LIFO operations: Stack Link
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With