[Scons-users] 回复: Scons-users Digest, Vol 144, Issue 8
Mats Wichmann
mats at wichmann.us
Mon Sep 25 13:27:57 EDT 2023
On 9/25/23 08:54, Eric Fahlgren wrote:
> On Mon, Sep 25, 2023 at 3:23 AM Yu,Zhiwei (YFI,Shanghai,CN)
> <zhiwei.yu at yanfeng.com <mailto:zhiwei.yu at yanfeng.com>> wrote:
>
> Hi Guys,
>
> I find that if I set -j8, the printing messages sequence
> will be disordered.
> I think the reason is python print buffer has competition
> in multithreading. Am I right?
> And how can I resolve it.
>
>
> As each subprocess has something to say, it says it. This is normal and
> expected for anything other that -j1. If you have a requirement that
> the output messages be sequential, then your only solution is to turn
> off multiple subprocesses and use -j1.
It's not clear exactly what the problem is. Will add these notes:
* SCons chooses the build order to best resolve the depndency graph.
That means things may not be built in the order you expect - that's one
possible form of out-of-order, and nothing to worry about.
* SCons prints its own message for each action, if those are too noisy
you can change what it prints, which might look clearer (if you don't
need the details). Those messages should not interfere with one
another, as those are happening inside Python.
* SCons has no control at all over what external commands output or when
they do, so those might indeed interleave, it multiple theads are in
use. For many commands, they don't actually say anything unless
something is wrong, but some are more talkative.
More information about the Scons-users
mailing list