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

  • Home
  • SEARCH
  • 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 101157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T00:43:02+00:00 2026-05-11T00:43:02+00:00

I am interested in writing separate program modules that run as independent threads that

  • 0

I am interested in writing separate program modules that run as independent threads that I could hook together with pipes. The motivation would be that I could write and test each module completely independently, perhaps even write them in different languages, or run the different modules on different machines. There are a wide variety of possibilities here. I have used piping for a while, but I am unfamiliar with the nuances of its behaviour.

  • It seems like the receiving end will block waiting for input, which I would expect, but will the sending end block sometimes waiting for someone to read from the stream?
  • If I write an eof to the stream can I keep continue writing to that stream until I close it?
  • Are there differences in the behaviour named and unnamed pipes?
  • Does it matter which end of the pipe I open first with named pipes?
  • Is the behaviour of pipes consistent between different Linux systems?
  • Does the behaviour of the pipes depend on the shell I’m using or the way I’ve configured it?
  • Are there any other questions I should be asking or issues I should be aware of if I want to use pipes in this way?
  • 1 1 Answer
  • 1 View
  • 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. 2026-05-11T00:43:03+00:00Added an answer on May 11, 2026 at 12:43 am

    Wow, that’s a lot of questions. Let’s see if I can cover everything…

    It seems like the receiving end will block waiting for input, which I would expect

    You expect correctly an actual ‘read’ call will block until something is there. However, I believe there are some C functions that will allow you to ‘peek’ at what (and how much) is waiting in the pipe. Unfortunately, I don’t remember if this blocks as well.

    will the sending end block sometimes waiting for someone to read from the stream

    No, sending should never block. Think of the ramifications if this were a pipe across the network to another computer. Would you want to wait (through possibly high latency) for the other computer to respond that it received it? Now this is a different case if the reader handle of the destination has been closed. In this case, you should have some error checking to handle that.

    If I write an eof to the stream can I keep continue writing to that stream until I close it

    I would think this depends on what language you’re using and its implementation of pipes. In C, I’d say no. In a linux shell, I’d say yes. Someone else with more experience would have to answer that.

    Are there differences in the behaviour named and unnamed pipes? As far as I know, yes. However, I don’t have much experience with named vs unnamed. I believe the difference is:

    • Single direction vs Bidirectional communication
    • Reading AND writing to the ‘in’ and ‘out’ streams of a thread

    Does it matter which end of the pipe I open first with named pipes?

    Generally no, but you could run into problems on initialization trying to create and link the threads with each other. You’d need to have one main thread that creates all the sub-threads and syncs their respective pipes with each other.

    Is the behaviour of pipes consistent between different linux systems?

    Again, this depends on what language, but generally yes. Ever heard of POSIX? That’s the standard (at least for linux, Windows does it’s own thing).

    Does the behaviour of the pipes depend on the shell I’m using or the way I’ve configured it?

    This is getting into a little more of a gray area. The answer should be no since the shell should essentially be making system calls. However, everything up until that point is up for grabs.

    Are there any other questions I should be asking

    The questions you’ve asked shows that you have a decent understanding of the system. Keep researching and focus on what level you’re going to be working on (shell, C, so on). You’ll learn a lot more by just trying it though.

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

Sidebar

Related Questions

I'm interested in writing a SMTP mail server that just sends emails? I would
I am interested in writing a program that calculates the value of Pi to
I'm interested in writing software that depends on being able to identify that there
I'm interested in writing javascript that will programmatically perform a screen capture of what
I'm interested in writing a boot loader for USB sticks that looks for a
I am interested in writing static code analyzer for vb.net to see if it
I'm interested in writing some basic computerized object recognition application, so I figure I
I am interested in writing a simplistic navigation application as a pet project. After
I am interested in writing utf-8 encoded strings to a file. I did this
I'm writing a program in C++ to perform a simulation of particular system. For

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.