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 7612073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:49:10+00:00 2026-05-31T01:49:10+00:00

Can a process which is writing to a pipe tell when a reader (in

  • 0

Can a process which is writing to a pipe tell when a reader (in a different process) is blocking because it is trying to read from the pipe and the pipe is currently empty?

If this is not possible with a pipe, is it possible with some other form of IPC?

I suspect the answer is no, but I thought I’d ask anyway.

The use case for this is to write to the pipe only when data is really needed by a reader.

  • 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-31T01:49:10+00:00Added an answer on May 31, 2026 at 1:49 am

    As far as I know it is not possible directly (only using a pipe). Even if you know the size of the pipe buffer (you can get by invoking fpathconf(pipefds[0],_PC_PIPE_BUF))) and you know that it is empty, there is still no guarantie that the other process is actually reading from it. Even if it is reading, it may do it in nonblocking mode. You may try to find out whether the other process is bloked on some system call (e.g.read), but even this would not be helpful (the other process may be reading something else at the moment).

    The only way that comes to my mind is using process semaphores. This requires that the other (e.g. child) process knows exactly which semaphore to use and how to use it. You can test if the samaphore is locked.

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

Sidebar

Related Questions

Greetings, I've taken over from a prior team and writing ETL jobs which process
I'm writing an Eclipse plug-in in which the user can interact with another process
I'm currently in the process of writing a programming language which extends C# mainly
I need to create a service which can process queued requests on a configured
On Windows I can do CreateProcess(..., CREATE_NEW_CONSOLE, ...) and my child process (which is
how can i process all radio buttons from the page? <input type=radio name=radio_1 value=some
The following is 2 different definitions of the problem: How can I process 2
Is there any way of writing pexpect like small program which can launch a
I am writing a program that starts another java process which runs certain code.
I'm in the process of writing an Add-in for Outlook07 which should store the

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.