From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from math.gatech.edu (euclid.skiles.gatech.edu [130.207.146.50]) by werple.net.au (8.7/8.7.1) with SMTP id LAA06151 for ; Fri, 17 Nov 1995 11:16:00 +1100 (EST) Received: by math.gatech.edu (5.x/SMI-SVR4) id AA00398; Thu, 16 Nov 1995 19:00:57 -0500 Resent-Date: Thu, 16 Nov 1995 18:57:35 -0500 Old-Return-Path: Message-Id: <199511162357.SAA01359@redwood.skiles.gatech.edu> X-Mailer: exmh version 1.6.4 10/10/95 To: zsh-workers@math.gatech.edu Subject: Re: Pid or not pid In-Reply-To: Your message of "Thu, 16 Nov 1995 16:57:47 +0100." <9511161557.AA20201@sgi.ifh.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 16 Nov 1995 18:57:35 -0500 From: Richard Coleman Resent-Message-Id: <"Tywm92.0.56.u2zgm"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/622 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > Some of the code in execcmd() is getting executed in the parent rather > than the child, presumably since the last rearrangement... in > particular, nice(5) is getting called if fork() returned a non-zero > pid, i.e. in the parent (line 1350 of exec.c). This means each time a > background process is forked, the parent shell has a lower priority. > This may be a good way to deal with process hogs, but I don't think > it's what's intended. This is for beta12-test2. This bug is not present in beta10 or beta11. rc *** exec.c 1995/11/16 03:31:23 1.89 --- exec.c 1995/11/16 22:05:14 *************** *** 1345,1353 **** read(synch[0], &dummy, 1); close(synch[0]); if (how & Z_ASYNC) { - /* Check if we should run this job at a lower priority */ - if (isset(BGNICE)) - nice(5); lastpid = pid; } else if (!jobtab[thisjob].stty_in_env && nonempty(cmd->vars)) { /* search for STTY=... */ --- 1345,1350 ---- *************** *** 1367,1372 **** --- 1364,1373 ---- forked = 1; if (sigtrapped[SIGINT] == 2) holdintr(); + /* Check if we should run background jobs at a lower priority. */ + if ((how & Z_ASYNC) && isset(BGNICE)) + nice(5); + } else if (is_cursh) { /* This is a current shell procedure that didn't need to fork. * * This includes current shell procedures that are being exec'ed, *