Re: Parallel build when using python build actions
Bill Deegan <[email protected]>
| Newsgroups | gmane.comp.programming.tools.scons.user |
|---|---|
| Message-ID | <CAEyG4CGMu4TtE2hYkMokeV_yBdMbQg30rYOjXAqnskXZm1E9Gg@mail.gmail.com> |
Ivan, If I understand correctly you have some complicated logic implemented in python and you want to embed that in SCons? Generally a bad idea. You would be better off to write builders which run those externally. Python doesn't have true threading with python logic due to the GIL. -Bill On Tue, Mar 9, 2021 at 2:59 AM Ivan <[email protected]> wrote: > Hi folks, > > I have my custom toolchain written in python. I want to import my > compiler/linker/assembler modules from the SConstruct file and call them as > Python functions instead of invoking them as scripts. > > I've managed to do that, but it seems that scons only executes one job at > a time. Here's my SConstruct: > https://github.com/imihajlow/ccpu/blob/scons-optimize/app/SConstruct > Here's what `time scons` outputs for python function actions: > > scons 8.80s user 0.77s system 108% cpu 8.807 total > > And here's with the normal string actions: > > scons 18.92s user 2.88s system 490% cpu 4.440 total > > You can see that the CPU time is much lower in the first case, but the > real time is twice as high because only one core is used. > > Am I doing something wrong or is that a bug/feature of scons? > > Best regards, > Ivan > _______________________________________________ > Scons-users mailing list > [email protected] > https://pairlist4.pair.net/mailman/listinfo/scons-users > _______________________________________________ Scons-users mailing list [email protected] https://pairlist4.pair.net/mailman/listinfo/scons-users