garyo edited this page Dec 13, 2014 · 1 revision

Serialise for shared resources

Some tasks are best executed in series, either because they share resources which are more efficiently utilised in series or they share unique resources which cannot be accesed simultaniously.

A simple solution is to only invoke scons without -j N, unless N = 1.

In a build consisting of a mixture of tasks that can be executed in parallel and tasks that need to be serialised, requiring all the tasks that can be run in parallel to execute in series is non optimal.

The solution for the tasks that you know share resources is to tell scons that they create the same dummy file as a side effect. Scons will avoid executing only these tasks in parallel to avoid simultaneous acess to this dummy file.




In this case when the script is invoked with scons -j 2 we should expect only x3.out to be created in parellel, the other two tasks should be completely serialised.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.