[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: multi-threaded compiling
From: |
Greg Wooledge |
Subject: |
Re: multi-threaded compiling |
Date: |
Mon, 11 Mar 2024 14:29:49 -0400 |
On Mon, Mar 11, 2024 at 07:22:39PM +0100, Mischa Baars wrote:
> On Mon, Mar 11, 2024 at 6:22 PM alex xmb sw ratchev <fxmbsw7@gmail.com>
> wrote:
>
> > i also completly dont get ur issue
> >
> > f=( a.c b.c .. ) threads=$( nproc ) i=-1 r=
> >
> > while [[ -v f[++i] ]] ; do
> > (( ++r > threads )) &&
> > wait -n
> > gcc -c "${f[i]}" &
> > done
> >
>
> How nice!
>
> wait -n exit 1 & echo $?
>
> You got me the solution :) Except that wait expects a pid after -n.
No, wait -n without a PID waits for any one job to complete.
hobbit:~$ sleep 123 & sleep 234 & sleep 3 & wait -n
[1] 513337
[2] 513338
[3] 513339
[3]+ Done sleep 3
hobbit:~$ ps
PID TTY TIME CMD
1138 pts/0 00:00:00 bash
513337 pts/0 00:00:00 sleep
513338 pts/0 00:00:00 sleep
513341 pts/0 00:00:00 ps
hobbit:~$
- Re: multi-threaded compiling, (continued)
- 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, 2024/03/11
- Re: multi-threaded compiling,
Greg Wooledge <=
- 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