[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: popen read and write?
- From: gary ng <garyng2000@...>
- Date: Mon, 8 Oct 2007 22:22:01 -0700 (PDT)
--- Edgar Toernig <froese@gmx.de> wrote:
> Second: use non-blocking file handles together with
> select/poll-like system calls to dispatch reading
> and writing yourself. That prohibits use of
> stdio. The stdio routines are not designed for non-
> blocking access and all kind of magic things
> happen. Even if you think you can get away with
> select and blocking I/O (you're
> wrong btw) stdio won't play nice with you.
You hit the nail of the problem in general though I
would appreciate comment on this.
Can't I just use COPAS and non-blocking io on
stdin/stdout(i.e. fh 0/1) ? As it seems to me it is no
different than a program launched by tcpserver ?
That is, I have two handler in COPAS, one is the
writer(on 1), the other the reader(on 0). I can write
until it blocks and if the sub-process have enough to
work on(some kind of filter) would trigger my reader
on next select() ?
____________________________________________________________________________________
Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online.
http://smallbusiness.yahoo.com/webhosting