[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: multi-threaded compiling
From: |
Mischa Baars |
Subject: |
Re: multi-threaded compiling |
Date: |
Mon, 11 Mar 2024 21:08:50 +0100 |
Like this:
seconds=1; for (( i=0;i<32;i++ )); do exit ${i} & done; sleep ${seconds};
for (( i=0;i<32;i++ )); do wait -np pid; e=${?}; echo "$(printf %3u ${i})
pid ${pid} exit ${e}"; done;
which again only works when called from a script. I have been looking for
the -p option. Guess I overlooked it.
Now you would have to look up the pid in the pid array of started 'exit
${i}''s to lookup the log file corresponding to that index. I suppose
waiting for the processes to end in the same order as they were started
isn't that bad a solution. You then have that index right at hand.
On Mon, Mar 11, 2024 at 8:49 PM Chet Ramey <chet.ramey@case.edu> wrote:
> On 3/11/24 2:46 PM, Mischa Baars wrote:
> > You mean:
>
> > for (( i=0; i<32; i++ )); do exit $i; done; for (( i=0; i<32; i++ )); do
> > wait -n; echo $?; done;
> >
> > Because this doesn't and to be honest, I needed the pid and its index to
> > retrieve gcc's output from a log file array afterwards.
>
> If you want the pid, take a look at the -p option to wait.
>
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
> ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
>
>
- Re: multi-threaded compiling, (continued)
- Re: multi-threaded compiling, alex xmb sw ratchev, 2024/03/11
- Re: multi-threaded compiling, Kerin Millar, 2024/03/11
- Re: multi-threaded compiling, Mischa Baars, 2024/03/11
- Re: multi-threaded compiling, Greg Wooledge, 2024/03/11
- Re: multi-threaded compiling, alex xmb sw ratchev, 2024/03/11
- Re: multi-threaded compiling, alex xmb sw ratchev, 2024/03/11
- Re: multi-threaded compiling, alex xmb sw ratchev, 2024/03/11
- Re: multi-threaded compiling, alex xmb sw ratchev, 2024/03/11
- Re: multi-threaded compiling, alex xmb sw ratchev, 2024/03/11
- Re: multi-threaded compiling, Chet Ramey, 2024/03/11
- Re: multi-threaded compiling,
Mischa Baars <=
- Re: multi-threaded compiling, Greg Wooledge, 2024/03/11
- Re: multi-threaded compiling, Paul Smith, 2024/03/11
- Re: multi-threaded compiling, Mischa Baars, 2024/03/11
- Re: multi-threaded compiling, Greg Wooledge, 2024/03/11
- Re: multi-threaded compiling, Mischa Baars, 2024/03/11
- Re: multi-threaded compiling, Mischa Baars, 2024/03/11
- Re: multi-threaded compiling, alex xmb sw ratchev, 2024/03/11
- Re: multi-threaded compiling, Paul Smith, 2024/03/11
Re: multi-threaded compiling, Martin D Kealey, 2024/03/12