help-make
[Top][All Lists]
Advanced

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

Re: Using named pipes for chains of implicit rules


From: Paul Smith
Subject: Re: Using named pipes for chains of implicit rules
Date: Fri, 11 Jun 2010 20:38:37 -0400

On Thu, 2010-06-10 at 16:05 -0700, Shaun Jackman wrote:
> For a chain of implicit rules, make creates intermediate files, which it
> removes afterwards. Could make use named pipes (mkfifo) to run the two
> commands (producing and consuming the intermediate file) in parallel?
> 
> If the intermediate file will not be removed for any reason (e.g. named
> as an explicit target or declared .SECONDARY), then a regular file would
> be used.

This really cannot work.  This only works if you can get the producer
and the consumer running at the same time.  In an environment like this,
the consumer would list the producer as a prerequisite, and so make will
never invoke the consumer until the producer is finished (which it
likely will never be since the pipe will fill up).  Trying to modify
make's algorithms to allow the target and prerequisite to be run in
parallel in this particular case would be an immense amount of work and,
I suspect, pretty unreliable in the end.

I worry that some tools would not like to read the named pipe.  Maybe
they do something like mmap() the file, or maybe they want to change it
in some way.  Also, currently I'm not sure make knows BEFORE it runs the
commands that this is an intermediate file (not sure about that).


-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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