Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
08-22-2022, 05:42 PM
|
#46
|
Member
Registered: Jul 2005
Distribution: Slackware
Posts: 244
Original Poster
Rep:
|
Quote:
Originally Posted by dugan
What an incredibly strange thing to say.
A pipe (named otherwise) is a FIFO queue.
|
I can tell that you don't understand the nature of the question yet you repeatedly insult me and steer the discussion off-topic. Should I assume that your personality is the same offline?
|
|
|
08-22-2022, 06:34 PM
|
#47
|
LQ Guru
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,351
|
I am acting in good faith here, and I'm doing so because I think you are too.
I find i interesting that the FIFO queue point, of all things, is where you suddenly reach your end, and respond solely with an actual ad-hominem attack that you clearly hope would shame me out of continuing. A point, I might add, where I did not insult you, did not do anything that could possibly be construed as trying to pull the thread off topic, and where, if I didn't understand you, then you should probably have a long, hard think about whose fault that actually is.
Last edited by dugan; 08-23-2022 at 01:08 AM.
Reason: If I didn't take out one of the italics, I know you'll attack me for the italics.
|
|
|
08-23-2022, 02:01 AM
|
#48
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,232
|
Quote:
Originally Posted by halfpower
Take the symbolic command "cmd1 | cmd2". Say that "cmd1" produces a bit of data and passes it to "cmd2". "cmd2" is now working on the data, but what is "cmd1" doing? It could sit there and wait for "cmd2" to finish. Alternatively, it could get to work on producing more data, and, thereby pass the next bit of data to "cmd2" somewhat sooner. If there are 15 commands instead of two, then the performance impact is likely to be more dramatic.
|
I can't follow you, but anyway, a process can block the next/previous process in the chain, and it is not related to the kernel, os or bash, it just depend on how those processes were designed/implemented. As usual, the performance of the entire chain depends on the weakest link.
Quote:
Originally Posted by halfpower
I can tell that you don't understand the nature of the question yet you repeatedly insult me and steer the discussion off-topic. Should I assume that your personality is the same offline?
|
No, I don't think Dugan meant to insult you. In fact, I'm quite sure of it. Better to say your statement was surprising. Also you should not deal with the person, but with the answer.
If you think your post was misunderstood please try to explain it better.
You can read about pipes for example here: https://en.wikipedia.org/wiki/Pipeline_(Unix) and here: https://en.wikipedia.org/wiki/Named_pipe. The latter explains the differences between named and "anonymous" pipes.
|
|
2 members found this post helpful.
|
08-23-2022, 12:43 PM
|
#49
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,963
|
(Gentlebeings, let us please just remain "on point." If you have anything else to say, that's what private messages are for.)
Now ... "There is no 'chain.'"
As I said earlier, the shell creates a series of independently-running child processes, and connects the STDOUT of one of them – by means of an anonymous "pipe" – to the STDIN of the next. "That's it." Then, it goes to sleep and waits for all of them to finish.
The "flexible hose" of the "pipe" construct does the rest of the magick. Both readers and writers might sometimes be "blocked" if the pipe is (respectively ...) empty or full, but all of the messages will get through. The nanosecond-to-nanosecond sequence of events is entirely unpredictable. The shell process plays no part at all in it – it is asleep until notified that all of the children have ended.
(Also: none of the child processes actually know nor care that their STDIN/STDOUT/[STDERR] streams are actually connected to "pipes." They neither know nor care that they are from time to time being "blocked." All they know is that eventually they will encounter "end of file," just as they would in any case.)
Last edited by sundialsvcs; 08-23-2022 at 12:50 PM.
|
|
1 members found this post helpful.
|
08-24-2022, 03:43 AM
|
#50
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,232
|
Quote:
Originally Posted by sundialsvcs
Now ... "There is no 'chain.'"
|
Yes, that is not an official designation of anything, just we used to say the construct of "several commands connected with pipes" is a chain.
see for example here: https://www.howtogeek.com/438882/how...ipes-on-linux/
|
|
|
08-24-2022, 12:58 PM
|
#51
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,963
|
Yes, I am familiar with that colloquial terminology, but I wanted to explicitly clarify how it actually works. The shell "sets up all the plumbing," then goes to sleep. The pipes then simply work as they always do.
|
|
|
08-25-2022, 02:10 AM
|
#52
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,232
|
Quote:
Originally Posted by sundialsvcs
Yes, I am familiar with that colloquial terminology, but I wanted to explicitly clarify how it actually works. The shell "sets up all the plumbing," then goes to sleep. The pipes then simply work as they always do.
|
Yes, I totally agree with you (hopefully it's clear to the OP now).
|
|
|
12-26-2022, 06:13 PM
|
#53
|
LQ Guru
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,351
|
Quote:
Originally Posted by halfpower
I can tell that you don't understand the nature of the question yet you repeatedly insult me and steer the discussion off-topic.
|
Just want to make clear that I had not posted anything off-topic. I have instead been extremely generous and given you a wealth of relevant information. Information that you needed to know to understand your question. If you failed to recognize that, then, well, the old proverb about horses and water applies.
Last edited by dugan; 12-27-2022 at 12:10 PM.
|
|
|
All times are GMT -5. The time now is 09:33 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|