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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:57:03+00:00 2026-05-26T11:57:03+00:00

I try to organize blocking transfer between parent-child processed using classic scheme fork()/pipe(), but

  • 0

I try to organize blocking transfer between parent-child processed using classic scheme fork()/pipe(),
but I coudn’t understand why only first read() in child is blocking, but all subsequent reads are not, and besides that they returns not zero result after read!

for example:

parent, first write filename to child, than wait for answer:

for (NSString* file in filenames) { 

        fprintf(pict_log, "send to conversion file %s\n", filename);
        write(g_pfds[1], filename, 512);
        memset(filename, ' ', 512);
        read(g_pfds[0], filename, 512);
        fprintf(pict_log, "completed for file: %s\n", filename);
}

child, the same but vice versa.

while(!g_break_child) 
{
            memset(filename, ' ', 512);
            int read_bytes = read(g_pfds[0], filename, 512);
            // some processing...
            write(g_pfds[1], filename, 512);
        }

I should be blocked on child’s read() after each iteration, but why this doesn’t happened?

  • 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-26T11:57:04+00:00Added an answer on May 26, 2026 at 11:57 am

    Now I could answer to myself, problem is:
    in my case I need bidirectional transfer, but when we open couple of descriptors through pipe() func, we thus create unidirectional channel, in case bi-directional transfer we need call pipe() twice to create two unidirectional pipes!

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

Sidebar

Related Questions

i am try to develop a small application. Now should i organize my 3rd
I'm using a header called colors.h to organize my source code. The header is
I have asked that question but there is no response so i'll try to
Like all developers with OCD I try to organise my namespaces within our project
Try loading this normal .jpg file in Internet Explorer 6.0. I get an error
try { ... } catch (SQLException sqle) { String theError = (sqle).getSQLState(); ... }
Try the following code public enum Color { Blue=1, Red=2, Green=3 } public List<Color>
Try executing the following in JavaScript: parseInt('01'); //equals 1 parseInt('02'); //equals 2 parseInt('03'); //equals
Try as I might I cannot get my head around what the IteratorIterator class
Try to see which cast is faster (not necessary better): new c++ case or

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.