[Scons-users] Suggestions for using MP Mutex during Action phase of build

Manohar Reddy manohar.mavilla at gmail.com
Fri Jan 29 11:14:15 EST 2021


Dear Scons Community users,

In SCons, we have support for a multi-process mutex that can be acquired by
each build variant to coordinate writing to a shared file. The mutex is
implemented through two methods:

env.AcquireMPMutex()
env.ReleaseMPMutex()

Example usage:

env.AcquireMPMutex("foo_file")
if not os.exists("foo.file"):
    env.FooBuilder("foo.file", "foo.source")
env.ReleaseMPMutex("foo_file")

But, this is currently not working for the action phase of the build.  In
the example above, the call to env.FooBuilder() is protected by the mutex,
but this only queues up the action for SCons to perform later, and by the
time SCons executes this action, the mutex will have already been released,
so the actual action is not being protected.

Can someone guide us on any alternative approach where the pre-action and
post-action are performed right before and after the execution of the
action?

Thanks
Manohar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20210129/a5c3a876/attachment.html>


More information about the Scons-users mailing list