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/


_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to