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
  • 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. 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

Ask A Question

Stats

  • Questions 134k
  • Answers 134k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer When you have to do it yourself, it can be… May 12, 2026 at 6:44 am
  • Editorial Team
    Editorial Team added an answer Fixed the problem by changing the order in which LSPs… May 12, 2026 at 6:44 am
  • Editorial Team
    Editorial Team added an answer It looks like the nid in the jstack output is… May 12, 2026 at 6:44 am

Related Questions

I am developing a scientific application used to perform physical simulations. The algorithms used
As developer, I am often interested in new language feature that can make your
Wherever possible I use TDD: I mock out my interfaces I use IOC so
We Want to Run Our C# Code on the JVM My company has a

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.