Re: multi-threaded compiling

2024-03-11 Thread Mischa Baars
) The two.make.log has the expected. The same commands executed from the bash script do not behave as expected. I'm having trouble obtaining the desired results with the bash script. Regards, Mischa Baars. On Mon, Mar 11, 2024 at 6:27 PM Paul Smith wrote: > On Mon, 2024-03-11 at 18:14 +0100, Mis

Re: multi-threaded compiling

2024-03-11 Thread Mischa Baars
On Mon, Mar 11, 2024 at 7:14 PM Greg Wooledge wrote: > On Mon, Mar 11, 2024 at 06:51:54PM +0100, Mischa Baars wrote: > > SECONDS=5; for (( i=0;i<32;i++ )); do { exit ${i}; } & pid[${i}]=${!}; > done; sleep ${SECONDS}; for (( i=0;i<32;i++ )); do wait -n ${pid[${i}]}; > e

Re: multi-threaded compiling

2024-03-11 Thread Mischa Baars
on, Mar 11, 2024 at 7:46 PM Mischa Baars wrote: > You mean: > > for (( i=0; i<32; i++ )); do exit $i & wait -n; echo $?; done; > > with one command and one wait in a single loop. And this does execute on > the command line. How interesting! > > for (( i=0; i<32; i

Re: multi-threaded compiling

2024-03-11 Thread Mischa Baars
On Mon, 11 Mar 2024, 20:20 Chet Ramey, wrote: > On 3/11/24 2:50 PM, Mischa Baars wrote: > > Which sort of brings us back to the original question I suppose. Who does > > that line of code function from a script and why does it fail from the > > command line? > > Job

Re: multi-threaded compiling

2024-03-11 Thread Mischa Baars
e logic between my code >> >> 1 threads_max >> 2 loop >> 3 inside loop , do if run is > than threads_max then wait -n one >> then 4 spawn thread >> > > 3 if run isnt more than max , simply ignore and spawn thread in next cmd > > i dont get ur points &

Re: multi-threaded compiling

2024-03-11 Thread Mischa Baars
t hand. On Mon, Mar 11, 2024 at 8:49 PM Chet Ramey 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 an

Re: multi-threaded compiling

2024-03-11 Thread Mischa Baars
Which sort of brings us back to the original question I suppose. Who does that line of code function from a script and why does it fail from the command line? My guess was that the same thing makes this line fail from the Makefile. On Mon, Mar 11, 2024 at 7:46 PM Mischa Baars wrote: > You m

Re: multi-threaded compiling

2024-03-11 Thread Mischa Baars
e > How nice! wait -n exit 1 & echo $? You got me the solution :) Except that wait expects a pid after -n. Maybe for (( i=0; i<32; i++ )); do exit 1 & wait -n $!; echo $?; done; is what you meant? The equivalence of sequential execution? First think, then do magic. > >

Re: multi-threaded compiling

2024-03-11 Thread Mischa Baars
On Mon, 11 Mar 2024, 20:36 Greg Wooledge, wrote: > > On Mon, Mar 11, 2024, 20:13 Mischa Baars > > wrote: > > > > > Also I don't think that gives you an exit status for each 'exit $i' > > > started. I need that exit status. > > "wait -n" withou

Re: multi-threaded compiling

2024-03-11 Thread Mischa Baars
Hi Greg, Good point. One for you :) Cheerz, Mischa. On Mon, Mar 11, 2024 at 7:14 PM Greg Wooledge wrote: > On Mon, Mar 11, 2024 at 06:51:54PM +0100, Mischa Baars wrote: > > SECONDS=5; for (( i=0;i<32;i++ )); do { exit ${i}; } & pid[${i}]=${!}; > done; sleep ${SECONDS}

Re: multi-threaded compiling

2024-03-11 Thread Mischa Baars
On Mon, 11 Mar 2024, 21:08 Kerin Millar, wrote: > On Mon, 11 Mar 2024 15:36:48 -0400 > Greg Wooledge wrote: > > > > On Mon, Mar 11, 2024, 20:13 Mischa Baars > > > > wrote: > > > > > > > Also I don't think that gives you an exit status for each

Re: multi-threaded compiling

2024-03-11 Thread Mischa Baars
one; 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. On Mon, Mar 11, 2024 at 7:25 PM alex xmb sw ratchev wrote: > > > On Mon, Mar 11, 2024, 19:22 Mischa Baars > wrote: > >> On Mon, Mar 11, 2024 at 6:2

Re: multi-threaded compiling

2024-03-12 Thread Mischa Baars
;32;i++ )); do exit ${i} & done; sleep ${seconds}; for (( i=0;i<32;i++ )); do wait -p pid; e=${?}; echo "$(printf %3u ${i}) pid ${pid} exit ${e}"; done;' disables / enables the notifications respectively, but doesn't do anything otherwise. On Mon, Mar 11, 2024 at 8:20 PM Chet Ramey wr

Re: multi-threaded compiling

2024-03-12 Thread Mischa Baars
On Mon, Mar 11, 2024 at 10:26 PM Chet Ramey wrote: > On 3/11/24 3:44 PM, Mischa Baars wrote: > > On Mon, 11 Mar 2024, 20:20 Chet Ramey, > <mailto:chet.ra...@case.edu>> wrote: > > > > On 3/11/24 2:50 PM, Mischa Baars wrote: > > > Which sort of

Re: multi-threaded compiling

2024-03-12 Thread Mischa Baars
able expansion. Therefore writing VAR=" \"string 1\" \"string 2\" " > absolutely cannot do what you might expect; the embedded quote marks will > be used literally, and then (because ${CFLAGS[0]} is not quoted) the > resulting string will be split on any embedded w

Re: multi-threaded compiling

2024-03-12 Thread Mischa Baars
-c '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;' On Mon, Mar 11, 2024 at 8:20 PM Chet Ramey wrote: > On 3/11/24 2:50 PM, Mischa Baars wrote: &

Re: multi-threaded compiling

2024-03-12 Thread Mischa Baars
edded whitespace.. > > So.. how do I make the script produce the same output as the Makefile? Using 'printf <%s>' as Chet said I should, does show the difference between the two, but it doesn't fix the problem. > > On Mon, 11 Mar 2024 at 18:56, Mischa Baars > wrote: > >> Hi,

Re: multi-threaded compiling

2024-03-12 Thread Mischa Baars
to do the job right. Best regards, Mischa. On Mon, Mar 11, 2024 at 8:20 PM Chet Ramey wrote: > On 3/11/24 2:50 PM, Mischa Baars wrote: > > Which sort of brings us back to the original question I suppose. Who does > > that line of code function from a script and why does it fail

Re: multi-threaded compiling

2024-03-12 Thread Mischa Baars
On Tue, Mar 12, 2024 at 12:49 PM Greg Wooledge wrote: > On Tue, Mar 12, 2024 at 09:42:22AM +0100, Mischa Baars wrote: > > Here's the script and the Makefile using "printf '<%s>'": > > Sadly, your mail user agent chose to attach "Makefile" with content-

Re: multi-threaded compiling

2024-03-13 Thread Mischa Baars
: > > > On Wed, Mar 13, 2024, 08:26 Mischa Baars > wrote: > >> On Tue, Mar 12, 2024 at 10:00 PM Paul Smith wrote: >> >> > On Tue, 2024-03-12 at 13:37 +0100, Mischa Baars wrote: >> > > > I'd still like to hear why you aren't simply using "make -j"

Re: multi-threaded compiling

2024-03-13 Thread Mischa Baars
On Wed, Mar 13, 2024 at 4:14 AM Martin D Kealey wrote: > > On Mon, Mar 11, 2024 at 8:20 PM Chet Ramey wrote: >> > On 3/11/24 2:50 PM, Mischa Baars wrote: >> > > Which sort of brings us back to the original question I suppose. Who >> does >> > > tha

Re: multi-threaded compiling

2024-03-13 Thread Mischa Baars
On Tue, Mar 12, 2024 at 10:00 PM Paul Smith wrote: > On Tue, 2024-03-12 at 13:37 +0100, Mischa Baars wrote: > > > I'd still like to hear why you aren't simply using "make -j". > > > > That's because I don't want to define static compile and link targets

Re: multi-threaded compiling

2024-03-14 Thread Mischa Baars
: > On Wed, 13 Mar 2024, Mischa Baars wrote: > > > Date: Wed, 13 Mar 2024 22:52:16 > > From: Mischa Baars > > To: alex xmb sw ratchev > > Cc: psm...@gnu.org, bug-bash , help-make@gnu.org > > Subject: Re: multi-threaded compiling > > > > I found another

Re: multi-threaded compiling

2024-03-15 Thread Mischa Baars
No? No further suggestions? Then I'd like to thank you all for your help and your input. I'll be off-list now. Kind regards, Mischa Baars. On Thu, Mar 14, 2024 at 9:17 AM Mischa Baars wrote: > Ok. Then this is what I was able to make of it. To be honest, I prefer the > Makefile synta

Fwd: multi-threaded compiling

2024-03-16 Thread Mischa Baars
: #1 #all: one two #2 #BIN=one two #all: $(BIN) #3 #all: # SRC=(*.c); BIN=$${SRC[*]%.c}; echo $${BIN}; #4 SRC=(*.c) BIN=$${SRC[*]%.c} all: $(BIN) > -Martin > > On Fri, 15 Mar 2024 at 18:17, Mischa Baars > wrote: > >> No? No further suggestions? >> >> Then I'd

multi-threaded compiling

2024-03-11 Thread Mischa Baars
explain to me what I'm doing wrong? Hope to hear from you soon. Best regards, Mischa Baars. 2024031100 - gnu questions.tar.xz Description: application/xz

Re: multi-threaded compiling

2024-03-11 Thread Mischa Baars
of the mail. In the attachment there are two directories, one and two, belonging to 1) and 2) respectively. I'm not into Vulcan mindmelds, so I hope everything from the first mail makes sense to you and everyone on this mailing list now. Best regards, Mischa Baars. On Mon, Mar 11, 2024 at 5:01 PM Paul