LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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


Reply
  Search this Thread
Old 08-22-2022, 04:42 PM   #46
halfpower
Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 241

Original Poster
Rep: Reputation: 31

Quote:
Originally Posted by dugan View Post
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?
 
Old 08-22-2022, 05:34 PM   #47
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
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 12:08 AM. Reason: If I didn't take out one of the italics, I know you'll attack me for the italics.
 
Old 08-23-2022, 01:01 AM   #48
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,804

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
Quote:
Originally Posted by halfpower View Post
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 View Post
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.
Old 08-23-2022, 11:43 AM   #49
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,647
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
(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 11:50 AM.
 
1 members found this post helpful.
Old 08-24-2022, 02:43 AM   #50
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,804

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
Quote:
Originally Posted by sundialsvcs View Post
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/
 
Old 08-24-2022, 11:58 AM   #51
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,647
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
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.
 
Old 08-25-2022, 01:10 AM   #52
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,804

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
Quote:
Originally Posted by sundialsvcs View Post
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).
 
Old 12-26-2022, 05:13 PM   #53
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,219

Rep: Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309Reputation: 5309
Quote:
Originally Posted by halfpower View Post
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 11:10 AM.
 
  


Reply

Tags
asynchronous task, blocking, command line, concurrency, pipes



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What route to access daisy chained 2d router 192.168.1.1 after 192.168.0.1 (subnets?) Emmanuel_uk Linux - Networking 6 05-05-2006 01:47 AM
how to create a chained js web form ? graziano1968 Programming 2 11-12-2004 03:55 AM
mounting a daisy chained firewire drive jamida Linux - Newbie 1 05-30-2004 09:08 PM
Daisy Chained Parallel Devices in Linux? JockVSJock Linux - Hardware 2 03-29-2004 08:58 PM
Daisy-chained || printer beckwith Linux - Hardware 0 08-28-2003 02:50 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration