Group: comp.os.linux.networking
From: David Schwartz
Date: Monday, March 24, 2008 6:26 AM
Subject: Re: Help: redirecting process input/output

On Mar 23, 11:12 pm, Knight wrote:

> Or is this the scenario you're visualizing: Parent writes
>to p2c[1] but blocks due to insufficient space. Child was
> already blocked on a write to its 1 (which used to be
> c2p[1] before all the close()/dup() stuff). Now neither
> will advance because neither is reading?

That is definitely one of the two ways it can deadlock.

> BTW in my situation (embedded system, limited RAM) I think
> it will be better to set sockets nonblocking, do select()
> for writes and reads both, and retry them; rather than 2
> forks.

That's a good solution, but it's a bit tricky to implement correctly.

DS

Safety Articles | Usenet Groups | Usenet News | Bluegrass