[Scons-users] Parallel build when using python build actions

Bill Deegan bill at baddogconsulting.com
Tue Mar 9 11:55:14 EST 2021


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 <ivan at imihajlov.tk> 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
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20210309/664b1fff/attachment.html>


More information about the Scons-users mailing list