zsh-users
 help / color / mirror / code / Atom feed
From: hanpingtian <hanpingtian@163.com>
To: zsh-users@zsh.org
Subject: job control problem
Date: Tue, 6 Mar 2012 18:01:38 +0800 (CST)	[thread overview]
Message-ID: <2c45df49.32a93.135e774fca6.Coremail.hanpingtian@163.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 732 bytes --]

 Hello,
I feel zsh's job control is a little weak than bash. For example, this script:

% cat t.sh
for ((i=1;i<=10000;i++))
do
    sleep 1 &
done

wait

With zsh:
% zsh -x ./t.sh
...
./t.sh:3: fork failed: resource temporarily unavailable
+./t.sh:6> wait
+./t.sh:3> sleep 1
it will fail with the fork() failure very soon.

But with bash:
% bash -x ./t.sh
...
+ (( i++ ))
+ (( i<=10000 ))
./t.sh: fork: retry: Resource temporarily unavailable
+ sleep 1
+ sleep 1
+ sleep 1
+ sleep 1
+ sleep 1
+ sleep 1
+ sleep 1
+ sleep 1
./t.sh: fork: retry: Resource temporarily unavailable
+ (( i++ ))
...
It can run more longer by retry and retry.
And I noticed that when trying to run a lot of jobs in background can cause zsh quit or frozen.


             reply	other threads:[~2012-03-06 10:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-06 10:01 hanpingtian [this message]
2012-03-07  5:46 ` Bart Schaefer
2012-03-07 13:45   ` Chet Ramey
2012-03-07 17:48     ` Bart Schaefer
2012-03-07 19:23       ` Chet Ramey
2012-03-08  4:25         ` Bart Schaefer
2012-03-07  9:16 ` hanpingtian

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2c45df49.32a93.135e774fca6.Coremail.hanpingtian@163.com \
    --to=hanpingtian@163.com \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).