[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Doubts about .WAIT and .NOTPARALLEL (was: GNU Make 4.4 released!)

From: Edward Welbourne
Subject: Re: Doubts about .WAIT and .NOTPARALLEL (was: GNU Make 4.4 released!)
Date: Mon, 31 Oct 2022 13:52:07 +0000

>>> I mean, considering the following example:
>>>       all: one two .WAIT three
>>>       one two three: ; @sleep 1; echo $@
>>> It's the same as if it was written as
>>>       all: one two three
>>>       three: one two
>>>       one two three: ; @sleep 1; echo $@
>>> Isn't it?

On 10/31/22 13:42, Edward Welbourne wrote:
>> Only from the point of view of make all; try make three and you'll see
>> the difference.
>> If you make three with the first make file, it'll take one second and
>> just echo three.  Passing -j 37 will make no difference.  If you make
>> three with the second make file, it'll take at least two seconds (three
>> with -j1) and output one and two (in some order) then three.
>> If you make all with the either makefile, it'll behave like make three
>> with the second makefile, but differently from make three with the first
>> makefile.
>> If any other targets depend on three, they're likewise changed by the
>> second makefile, compared to the first,

Alejandro Colomar (Monday, October 31, 2022 13:46) replied:
> Ahh, sure, that's right.
> However, I don't see why this would be beneficial.  Why would A need
> to be built before B, if there's no dependency between them?

If each of them needs to lock some resource to do its job, you don't
want them to be run in parallel.  For example, each of them appends to a
common log file, and you don't want their log entries interleaved; or
each updates a database with a new record relating to the present build.
Cases like this are also relevant to .NOT_PARALLEL; you might not care
what order the entries are processed in, just so long as no two of them
are trying to run at the same time.

That probably applies to all sorts of resources that take incremental
updates; make is a tool for doing the sorts of update that completely
rewrite a file, not the sort that add entries incrementally.

I have no doubt users of make will discover a plethora of other ways
that this is useful.

> I think this is hiding some kind of missing dependency.  Maybe this is
> a workaround for not having post-requisites yet?

While it might be used as a kludge-around for some such cases, it has
uses that cannot be represented faithfully be dependencies and really
just come down to "these two targets should not be built in parallel".


reply via email to

[Prev in Thread] Current Thread [Next in Thread]