Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 8 Jul 2001 20:40:55 +0300
From:      Giorgos Keramidas <keramida@ceid.upatras.gr>
To:        Gabriel Ambuehl <gabriel_ambuehl@buz.ch>
Cc:        David Leimbach <leimbacd@bellsouth.net>, freebsd-questions@FreeBSD.ORG
Subject:   Re: Passing data in C++ via stdin without waiting for the new process to  complete
Message-ID:  <20010708204055.C81559@hades.hell.gr>
In-Reply-To: <186598221416.20010708184347@buz.ch>; from gabriel_ambuehl@buz.ch on Sun, Jul 08, 2001 at 06:43:47PM %2B0200
References:  <114577608557.20010708130014@buz.ch> <3B484403.1BA9A21D@jak.nl> <84594262844.20010708173749@buz.ch> <20010708104356.B5630@mutt.home.net> <186598221416.20010708184347@buz.ch>

next in thread | previous in thread | raw e-mail | index | archive | help
From: Gabriel Ambuehl <gabriel_ambuehl@buz.ch>
Subject: Re[2]: Passing data in C++ via stdin without waiting for the new process to  complete
Date: Sun, Jul 08, 2001 at 06:43:47PM +0200

> Sounds pretty expensive. I think I'll go for a bunch of daemons that
> communicate via TCP/IP with the master one and then do whatever they
> need to. Forking forking the master daemon doesn't seem to be a very
> good idea as it sometimes gets pretty large and thus this would be
> pretty expensive...

You can also use shared memory or some other way of 'sharing the data'
among processes, without having to pass it through stdin, stdout.

If you use pipes and stdin/stdout as the basis of communicating things
among your programs, I'm afraid you can't do what you are trying to do
without losing some data.  There is buffering in the kernel of pipe
data, but buffers are not infinite.  They are limited by the amount of
free memory in your machine, for instance.

Temporary files, SYSV shared memory, are a few other things that you
could use to pass data among processes without having the receiver
wait for the sender to finish, or the sender wait for the receiver to
'consume' the data before it exits.

-giorgos

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010708204055.C81559>