Sujet : Re: The joy of pipes
De : 186283 (at) *nospam* ud0s4.net (186282@ud0s4.net)
Groupes : comp.os.linux.miscDate : 16. Nov 2024, 06:37:35
Autres entêtes
Organisation : wokiesux
Message-ID : <kaOcndi2KbU9sqX6nZ2dnZfqnPSdnZ2d@earthlink.com>
References : 1 2 3 4 5 6 7 8 9
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0
On 11/15/24 6:20 AM, Louis Krupp wrote:
On 11/15/2024 12:49 AM, 186282@ud0s4.net wrote:
On 11/14/24 9:05 PM, Lawrence D'Oliveiro wrote:
On Thu, 14 Nov 2024 16:09:07 -0800, John Ames wrote:
>
(I think it was a topic shift to applications of *nix pipes...?)
>
Oh shelly boy, the pipes, the pipes are calling ...
>
Pipes are good.
>
But, really, they're just temp files the parent
process can access.
Pipes *could* be implemented with temporary disk files, at least to an extent, but as far as I can tell, they're not.
Well, they can be on ACTUAL disk space - or on
a RAMdisk or just a reserved stretch of RAM.
The last one is quickest - but most taxing on
run-time resources.
Quoting from this page:
https://www.geeksforgeeks.org/piping-in-unix-or-linux/#
In Linux, a pipe is not a regular file but a type of inter-process
communication (IPC) mechanism that acts as a buffer, which can be
used to connect the output of one process to the input of another.
Although pipes are not files, they are implemented using file
descriptors and share many behaviors with files. They exist only in
memory and do not have a presence in the file system, unlike regular
files.
There are clearly a lot of ways to implement "pipes".
'C' does it the 'C' way.
IF you are doing multi-threaded/process style pgms then you
almost HAVE to use them if you want to xmit more than
a few bytes between parents/children. A few years back
I was experimenting with TCP/UDP servers and found that
it could be very useful to transmit a few dozen bytes
worth of active data between parents/children.
SO ... learn yer pipes !