bug-make
[Top][All Lists]
Advanced

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

[bug #54854] multi-target rules invoked too often with -j2


From: Bernhard M.
Subject: [bug #54854] multi-target rules invoked too often with -j2
Date: Wed, 17 Oct 2018 07:08:16 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0

URL:
  <https://savannah.gnu.org/bugs/?54854>

                 Summary: multi-target rules invoked too often with -j2
                 Project: make
            Submitted by: bmwiedemann
            Submitted on: Wed 17 Oct 2018 11:08:15 AM UTC
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
       Component Version: None
        Operating System: None
           Fixed Release: None
           Triage Status: None

    _______________________________________________________

Details:

Seen in the wild at https://github.com/github/hub/pull/1892
I made a minimal reproducer (attached).

To reproduce:
tar xf makebug.tar.gz
cd makebug/
make clean ; time make -j2
make clean ; time make -j1

notice how the -j2 takes longer than -j1
because in make -j1, the multi-target rule to create all man-pages is just
invoked once, but with -j2 it is invoked three times - once per input file,
not only wasting compute resources, but also creating a chance for race
conditions.

Maybe there is a better (parallelism-safe) way to specify such cases where one
command turns many input files into many output files than the bison-example
at https://www.gnu.org/software/make/manual/make.html#Pattern-Examples ?



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Wed 17 Oct 2018 11:08:15 AM UTC  Name: makebug.tar.gz  Size: 16KiB   By:
bmwiedemann

<http://savannah.gnu.org/bugs/download.php?file_id=45219>

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?54854>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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