Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

job control problem



 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.



Messages sorted by: Reverse Date, Date, Thread, Author