bug-make
[Top][All Lists]
Advanced

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

Re: Fwd: [RFC]serialize the output of parallel make?


From: Tim Murphy
Subject: Re: Fwd: [RFC]serialize the output of parallel make?
Date: Tue, 3 Aug 2010 07:51:22 +0100

Hi,

Since some things happen at the same time there is no single "serial
order".  The semaphore mechanism, forces one of the possible orders.

I forgot to say that for recipes with multiple commands you need to
either use the new .ONESHELL target or do this kind of thing:

mytarget:mytarget:
->command1 && \
->command2 && \
->command3

This causes them to be executed in a single shell invocation for which
the output can be gathered together

(I am using -> to indicate TAB)

With .ONESHELL, as I understand it, you would not need the '\'
characters to escape the end-of-line:

mytarget:
->command1 &&
->command2 &&
->command3


Note that I'm using bash syntax here.  On windows if you want to use
cmd.exe then good luck - I don't think it's really fit for purpose.

Regards,

Tim

On 3 August 2010 02:11, Chiheng Xu <address@hidden> wrote:
> On Mon, Aug 2, 2010 at 4:22 PM, Edward Welbourne <address@hidden> wrote:
>>> If my guess is not wrong, the semaphore safeguard the consistency of
>>> output of one command, not the order of commands.
>>
>> well, with -j, commands are being run concurrently, so there *isn't* a
>> strict ordering of commands to "safeguard", although output shall be
>> delivered in roughly the order of completion of commands, with only
>> minor disturbances.
>>
>> Still, if target A is a prerequisite of B, the recipe to make A is
>> run, and must complete, before the recipe to make B will be initiated;
>> since the recipe for A ends with whatever is ensuring its output comes
>> out as an atom, A's output is produced before B's recipe is initiated,
>> so you can be sure they appear in the right order.  So the only
>> ordering property among commands that actually matters *is* preserved.
>>
>
> This is not my ideal solution.
>
> My idea is to preserve the order of output of parallel make as if it
> is a "serial make".
>
> Modern CPU can issue multiple instructions simultaneously, but
> preserve the order of commit to program order. So the instruction
> level parallelism of CPU is transparent to programmer.
>
> What I want is transparent "parallel make".   Make can issue multiple
> shells simultaneously, but print their outputs in the same order as in
> a serial make.
>
>
>
>
> --
> Chiheng Xu
> Wuhan,China
>
> _______________________________________________
> Bug-make mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/bug-make
>



-- 
You could help some brave and decent people to have access to
uncensored news by making a donation at:

http://www.thezimbabwean.co.uk/



reply via email to

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