From owner-freebsd-questions Sun Jul 8 12:11:49 2001 Delivered-To: freebsd-questions@freebsd.org Received: from mailsrv.otenet.gr (mailsrv.otenet.gr [195.170.0.5]) by hub.freebsd.org (Postfix) with ESMTP id 7827D37B401 for ; Sun, 8 Jul 2001 12:11:45 -0700 (PDT) (envelope-from keramida@ceid.upatras.gr) Received: from hades.hell.gr (patr530-b066.otenet.gr [195.167.121.194]) by mailsrv.otenet.gr (8.11.1/8.11.1) with ESMTP id f68JBeh17870; Sun, 8 Jul 2001 22:11:41 +0300 (EEST) Received: (from charon@localhost) by hades.hell.gr (8.11.4/8.11.4) id f68Hetx81798; Sun, 8 Jul 2001 20:40:55 +0300 (EEST) (envelope-from keramida@ceid.upatras.gr) Date: Sun, 8 Jul 2001 20:40:55 +0300 From: Giorgos Keramidas To: Gabriel Ambuehl Cc: David Leimbach , 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> References: <114577608557.20010708130014@buz.ch> <3B484403.1BA9A21D@jak.nl> <84594262844.20010708173749@buz.ch> <20010708104356.B5630@mutt.home.net> <186598221416.20010708184347@buz.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <186598221416.20010708184347@buz.ch>; from gabriel_ambuehl@buz.ch on Sun, Jul 08, 2001 at 06:43:47PM +0200 X-PGP-Fingerprint: 3A 75 52 EB F1 58 56 0D - C5 B8 21 B6 1B 5E 4A C2 X-URL: http://students.ceid.upatras.gr/~keramida/index.html Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG From: Gabriel Ambuehl 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