Sujet : Re: Are We Back to the "Wars" Now ?
De : geoff (at) *nospam* clare.See-My-Signature.invalid (Geoff Clare)
Groupes : comp.os.linux.miscDate : 17. Dec 2024, 14:34:30
Autres entêtes
Message-ID : <68b83l-jtd.ln1@ID-313840.user.individual.net>
References : 1 2 3 4 5 6 7
User-Agent : Pan/0.154 (Izium; 517acf4)
The Natural Philosopher wrote:
On 14/12/2024 15:54, root wrote:
If you create a tmpfs /ram directory then pipes or named
files would both work in ram, and there would be no
functional difference.
I am not sure how pipes work as to be certain of that.
In fact quite the opposite is true; there is a very real and
easily noticeable functional difference.
If you use a regular file in a tmpfs to transfer data between two
processes, the amount of data you can transfer is limited to the
free space on the tmpfs, unless you go to great lengths to put
logic into the two processes to coordinate the reading and writing
such that the file never grows larger than a certain size and is
overwritten as necessary. You also need a way for the writer to
indicate to the reader that all of the data has been written.
With a pipe or FIFO, you just use simple read and write operations
and the system handles all the messy stuff for you. If the pipe
reaches capacity, write blocks until there is room to write some
more; if the pipe becomes empty, read blocks until there is more
data available; when read returns EOF that's the end of the data.
-- Geoff Clare <netnews@gclare.org.uk>