From owner-freebsd-questions Sun Jul 8 8:41:55 2001 Delivered-To: freebsd-questions@freebsd.org Received: from imf16bis.bellsouth.net (mail116.mail.bellsouth.net [205.152.58.56]) by hub.freebsd.org (Postfix) with ESMTP id 27BA037B401 for ; Sun, 8 Jul 2001 08:41:51 -0700 (PDT) (envelope-from leimbacd@bellsouth.net) Received: from mutt.home.net ([216.76.187.184]) by imf16bis.bellsouth.net (InterMail vM.5.01.01.01 201-252-104) with ESMTP id <20010708154242.VXJY24119.imf16bis.bellsouth.net@mutt.home.net>; Sun, 8 Jul 2001 11:42:42 -0400 Received: (from dave@localhost) by mutt.home.net (8.11.3/8.11.3) id f68Fjqf05717; Sun, 8 Jul 2001 10:45:52 -0500 (CDT) (envelope-from dave) Date: Sun, 8 Jul 2001 10:45:52 -0500 From: David Leimbach To: Gabriel Ambuehl , questions@freebsd.org Subject: Re: Passing data in C++ via stdin without waiting for the new process to complete Message-ID: <20010708104552.C5630@mutt.home.net> References: <114577608557.20010708130014@buz.ch> <3B484403.1BA9A21D@jak.nl> <84594262844.20010708173749@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: <84594262844.20010708173749@buz.ch>; from gabriel_ambuehl@buz.ch on Sun, Jul 08, 2001 at 05:37:49PM +0200 X-Operating-System: FreeBSD mutt.home.net 4.3-RELEASE FreeBSD 4.3-RELEASE 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 > > Oh I've read all of those (except the dup() stuff). It's just that I > think > that all of the fork derivatives won't do me any good as they are > thought to fork another copy of the current process as does, for > example, > Apache 1.3 to achieve simultaneous handling of concurrent requests. > But I > need to spawn separate, distinct executables that perform their very > own tasks, not just a copy of the calling process. > > The exec() family of calls looks more promising, but those still > block the parent process. I need a solution, that allows the parent > process to continue its work immediately after the child has been > spawned, no matter how long it takes the child to complete. They don't block the parent... they overwrite the current. int main () { pid_t pid = fork(); if (!pid) { //in child execl(...); //do something else } else { //in parent code } There is NO BLOCKING!!!! > Dave To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message