From owner-freebsd-questions Sun Jul 8 11:44:36 2001 Delivered-To: freebsd-questions@freebsd.org Received: from cactus.fi.uba.ar (cactus.fi.uba.ar [157.92.49.108]) by hub.freebsd.org (Postfix) with ESMTP id C857B37B405 for ; Sun, 8 Jul 2001 11:44:31 -0700 (PDT) (envelope-from fgleiser@cactus.fi.uba.ar) Received: from cactus.fi.uba.ar (cactus.fi.uba.ar [157.92.49.108]) by cactus.fi.uba.ar (8.11.3/8.9.3) with ESMTP id f68IhH351587; Sun, 8 Jul 2001 15:43:17 -0300 (ART) (envelope-from fgleiser@cactus.fi.uba.ar) Date: Sun, 8 Jul 2001 15:43:17 -0300 (ART) From: Fernando Gleiser To: Gabriel Ambuehl Cc: Subject: Re[2]: Passing data in C++ via stdin without waiting for the new process to complete In-Reply-To: <186598221416.20010708184347@buz.ch> Message-ID: <20010708152330.A48298-100000@cactus.fi.uba.ar> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 On Sun, 8 Jul 2001, Gabriel Ambuehl wrote: > -----BEGIN PGP SIGNED MESSAGE----- > > Hello David, > > Sunday, July 08, 2001, 5:43:56 PM, you wrote: > > > fork and execl!!! > > > execl replaces the current process. So fork then execl. > > 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... How many processes per second are you going to spawn? This is the standard way of building servers. In fact, this is how most of the system daemons work (SMTP daemon, inetd, sshd, ftpd, lpd, etc). The shell forks itself and the execs the command you typed. getty(8) execs login(1) which execs you login shell. The only exceptions are web servers and other bests where you expect to get 1000s of connections per second. Besides, are you sure that the added overhead involved in the message passing isn't bigger than the fork and exec? again: go and read stevens books. "Unix Network Programming" has a chapter about server architectures. Fer > > Best regards, > Gabriel > R > > -----BEGIN PGP SIGNATURE----- > Version: PGP 6.5i > > iQEVAwUBO0h/ucZa2WpymlDxAQEz6AgAlC83VUf47HfI51fWyHC3vuiVbX/bmMJT > 2ZaR5UGFaUxXj8GOMUVVcQp1Def172/R04IukmO7XdscbsQft6cv2ISDPKWsL7Iz > ghX5o17WBXXjRCOpK5aAvB52BDmtKqK475U7pUaihyUMRPCmhWxe+qBf9+Relog6 > yjmi+jD7M1Q0ehBsQqEsrUIAOGvfiXhzSTwZCtB81YT9/KF3jUA6Epflj4q97RkU > 9imY1DCo2QEK3rGkmBKh7r+7bLgb9Qj1/16AVcGlLV1gEO+8L3sZKcBgvEEy+cEi > /2pDcY/k/tCa0R2I7hz0fNiCpzzNi08Y4Sn24m4vmSMq+NayCZbKPw== > =CAHy > -----END PGP SIGNATURE----- > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message