Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6730033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:21:36+00:00 2026-05-26T10:21:36+00:00

I’m currently reading Advanced Programming in the Unix Environment by Stevens/Rago. Within the process

  • 0

I’m currently reading Advanced Programming in the Unix Environment by Stevens/Rago.

Within the process group section of the book, the author discusses how process groups are utilized commonly by shells for pipelining.

For example, the argument shown below could have been generated by
shell commands of the form:

proc1 | proc2 & proc3 | proc4 | proc5

Lots of other resources also discuss the relationship between process groups and pipelining. However, the one thing which I cannot find is an explanation of how the pipelining portion of this is implemented.

I know that in posix/unix shells like Boune-again shell (BASH), processes in a pipeline are executed in parallel — that is, in the previous example showing proc3 | proc4 | proc5, all three of these processes are simultaneously executed. The stdin of proc4 is connected to the stdin of proc3. (I also know that MS-DOS used temporary files and did not execute pipes in parallel, but let’s ignore that for the moment).

So, I’ve got proc3, proc4, proc5 all in a process group. Fantastic. How does this actually help with creating the pipelines between them?

As far as I can tell, I need to do the following to enable pipelining in a shell which I build:

  1. Create N-1 pipelines, where N is the number of processes in the
    pipelined statement fork() the shell process N times
  2. In each forked process, I need to use dup2 to properly set up the
    shared pipelines
  3. Then, after all of the forked processes have confirmation that they
    have all finalized setting up their pipes (likely via some IPC via a
    shared memory space), each can then run exec() and actually launch
    their respective processes.

However, all of the texts which I keep reading act as if process groups provide some magical functionality to create these pipelines — or they are simply neglecting to mention the procedure I outlined above.

Any comments or advice is always appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T10:21:36+00:00Added an answer on May 26, 2026 at 10:21 am

    Process groups don’t magically provide the pipes. You do need to set the pipes up as you describe (except that you don’t need any kind of confirmations in step 3 – each processes just starts using its pipes, and if the other end isn’t set up yet, it will simply block until it is).

    The “magic” that process groups provide is around the handling of signals and sharing a terminal.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am reading a book about Javascript and jQuery and using one of the
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am currently running into a problem where an element is coming back from
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have thousands of HTML files to process using Groovy/Java and I need to
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.