Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Buffer of stdio and pty
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?

Report this thread to moderator Post Follow-up to this message
Old Post
cherico
09-19-04 08:58 PM


Re: Buffer of stdio and pty
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

Report this thread to moderator Post Follow-up to this message
Old Post
Rich Teer
09-20-04 01:58 AM


Re: Buffer of stdio and pty
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

Report this thread to moderator Post Follow-up to this message
Old Post
Jonathan Adams
09-20-04 01:58 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Unix Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 05:14 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.