Buffer of stdio and pty
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > Buffer of stdio and pty




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Buffer of stdio and pty  
cherico


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-23-04 02:21 AM

IIRC, stdio is full buffered and pseudo-terminal is line-buffered.

When a process calls pty_fork() to spawn a child process, they
communicate through line-buffered pseudo-terminal and both the stdio
descriptors of the child process are associated with the pty.

My question is:

If stdio is full-buffered, does the pty's line-buffered policy help
with deadlocks?

full-buffered stdio + line-buffered pty = full-buffered foo?

It that right?





[ Post a follow-up to this message ]



    Re: Buffer of stdio and pty  
Rich Teer


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-23-04 02:22 AM

On Sun, 19 Sep 2004, cherico wrote:

> IIRC, stdio is full buffered and pseudo-terminal is line-buffered.

It's not that simple.  It depends which I/O stream you're talking
about, and what it's connected to.

> When a process calls pty_fork() to spawn a child process, they
> communicate through line-buffered pseudo-terminal and both the stdio
> descriptors of the child process are associated with the pty.

Which version of pty_fork?  It's not a standard function.

> If stdio is full-buffered, does the pty's line-buffered policy help
> with deadlocks?
>
> full-buffered stdio + line-buffered pty = full-buffered foo?

There's some discussion of this in my book, Solaris Systems
Programming.  But yes, a pty can be used to avoid deadlock
between coprocesses that use standard I/O.

HTH,

--
Rich Teer, SCNA, SCSA, author of "Solaris Systems Programming",
published in August 2004.

President,
Rite Online Inc.

Voice: +1 (250) 979-1638
URL: http://www.rite-group.com/rich





[ Post a follow-up to this message ]



    Re: Buffer of stdio and pty  
Jonathan Adams


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-23-04 02:22 AM

In article <afc115ec.0409191056.6539b193@posting.google.com>,
cherico@bonbon.net (cherico) wrote:

> IIRC, stdio is full buffered and pseudo-terminal is line-buffered.
>
> When a process calls pty_fork() to spawn a child process, they
> communicate through line-buffered pseudo-terminal and both the stdio
> descriptors of the child process are associated with the pty.

It's polite to give background information or code for any non-system
provided routines.  My system doesn't provide pty_fork().

> My question is:
>
> If stdio is full-buffered, does the pty's line-buffered policy help
> with deadlocks?
>
> full-buffered stdio + line-buffered pty = full-buffered foo?
>
> It that right?

No.  You might consider reading stdio(3) in full.  And think about what
you mean by "line-buffered pty".

Cheers,
- jonathan





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 11:48 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register