I'll be short in my question. I'm setting up 'num_jobs' environment option. As you might know it makes SCons run in multithreading mode (depends on cpu count). In my custom builder I call some outer executable via subprocess which prints some output to stdout.
So the question is: how to synchronize that output to stdout? I need to synchronize output because I have 4 cpus and during building I have messed up information.
Thanks.
You can use SideEffect.
def MyFunc(env, param):
run_ret = env.Command(... external command using param ...)
# ensure that no unit tests are run in parallel
env.SideEffect('#/GLOABL_LOCK', run_ret)
Then AddMethod MyFunc to your environment.
The SideEffect ensures that the different calls to the Command won't be simultaneous.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With