Re: Suggestions for using MP Mutex during Action phase of build

Luke Robison <[email protected]>
Newsgroups gmane.comp.programming.tools.scons.user
Message-ID <CAE9Hkk=6r8yor0xvM3sB3YjKY8AcvAkt5mCVjt=5QZXzEqBNsw@mail.gmail.com>
I'm not sure what problem exactly you are trying to solve, but one thing
I've done is out-of-place builds in different folders for different build
configurations.  We use this to switch between debug and release versions
without rebuilding everything.

I haven't tried to execute those builds simultaneously, but perhaps that
would help your problem?

On Sat, Jan 30, 2021, 9:26 AM Mats Wichmann <[email protected]> wrote:

> On 1/29/21 10:52 PM, Manohar Reddy wrote:
> > Hi Bill,
> >
> > Thanks for your prompt response.
> >
> > We run multiple builds in parallel in different processes. Would calling
> > SideEffect() from one build in one process prevent mutual access to a
> > file from other builds running in separate processes?
>
> No.
>
>
> >         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.
>
> As I guess you've seen, this isn't really of any use, as these
> instructions will take place during the SConscript reading phase, when
> no file building takes place. SCons uses its time in this phase to build
> up the complete dependency graph, before starting the build phase, where
> a component called the Taskmaster walks this graph and enqueues and
> fires off the individual build jobs (consisting of one or more actions)
> as they become eligible to build. You're going to have to reach inside
> SCons/Executor.py to find where the actions are actually executed - and
> this is very internal not-public-API type code.  This probably isn't
> ideal - there's already Python's own (per-process) Global Interpreter
> Lock and you're going to add another level of locking, but only you know
> the scope of the problem you need to solve....
>
>
> _______________________________________________
> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.