From owner-freebsd-questions Fri Dec 27 08:07:45 1996 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id IAA25386 for questions-outgoing; Fri, 27 Dec 1996 08:07:45 -0800 (PST) Received: from xmission.xmission.com (softweyr@xmission.xmission.com [198.60.22.2]) by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id IAA25381 for ; Fri, 27 Dec 1996 08:07:43 -0800 (PST) Received: (from softweyr@localhost) by xmission.xmission.com (8.8.4/8.7.5) id JAA19151; Fri, 27 Dec 1996 09:07:32 -0700 (MST) From: Softweyr LLC Message-Id: <199612271607.JAA19151@xmission.xmission.com> Subject: Re: multi-media app runs out of forking capabilities To: kline@tera.com (Gary Kline) Date: Fri, 27 Dec 1996 09:07:32 -0700 (MST) Cc: questions@freebsd.org In-Reply-To: <199612270100.RAA10931@athena.tera.com> from "Gary Kline" at Dec 26, 96 05:00:28 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk On Thu, 26 Dec 1996, Gary Kline wrote: > I didn't think that this would stall my devlopment, but > it has. Before I upgraded to 32MB of memory I sometimes > would get a ``Can't fork'' error from the kernel. I > thought that having 32 megs would automagically resolve > this problems, but no such luck. > > Now I'm writing a multi-media app that does many forks > to spawn and kill ancillary processes, and I am getting > the same `can'tt fork' messages. And later asked: > Will do, thanks.. I've also thought of another > way that would obviate all these scores of forks:: > Using whatever IPC that FBSD has might work. > > Is there a way that one program can send a flag > to another program? Assuming yes, where is some > sample code?? Sure. Signals are a simple, but error prone way. A UNIX-domain socket or a FIFO would work well, or even a MSGQ. You can find instructions on using most (or maybe all) of these in W. Richard Stevens' excellent books _UNIX Network Programming_ (0-13-949876-1) and _Advanced Programming in the UNIX Environment_ (0-201-56317-7), both from Prentice Hall. Your 'can't fork' messages may be caused by the per-process limits on child processes. Are you gathering the status of your child processes with wait(2) at any point? If not, all of your child processes will remain counted against your per-process limit until you wait() for them. Richards UNIX book will explain the UNIX process model and the relation- ship between parent and child processes better than I can here. ;^) -- "Where am I, and what am I doing in this handbasket?" Wes Peters Softweyr LLC http://www.xmission.com/~softweyr softweyr@xmission.com