zsh-users
 help / color / mirror / code / Atom feed
* job control problem
@ 2012-03-06 10:01 hanpingtian
  2012-03-07  5:46 ` Bart Schaefer
  2012-03-07  9:16 ` hanpingtian
  0 siblings, 2 replies; 7+ messages in thread
From: hanpingtian @ 2012-03-06 10:01 UTC (permalink / raw)
  To: zsh-users

[-- 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.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-03-08  4:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-06 10:01 job control problem hanpingtian
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

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).