Code Comments
Programming Forum and web based access to our favorite programming groups.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 Follow-up to this messageOn 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 Follow-up to this messageIn 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 Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.