Suggestion to induce a random delay before compiling.

Andrew Haley aph@redhat.com
Mon Sep 20 01:17:00 GMT 2010


On 19/09/10 14:01, Dr. David Kirkby wrote:
> We have noted on the Sage maths project that we get occasional build
> failures when the constituent parts are built in parallel. Each time a
> bug is found, the Makefile gets edited, only for another to be found. I
> built one component called "Singular" 110 times and it worked in all 110
> times. I did this in 4 directories and started the builds at different
> times, but still I got the problem.
> 
> Others had built this package in parallel too. Then a Linux user
> suddenly gets a a build failure due to a race condition.
> 
> This got me thinking if there was a way to make such race conditions
> more easily found. One idea I had was for gcc to have an option to sleep
> for a random time before it actually did anything. So if file A takes
> longer to compiler than file B, by introducing some random element, this
> would change. This should make uncovering race conditions much easier.
> 
> Does that sound a sensible idea?

Sure, but it's a trivial wrapper script.

Andrew.



More information about the Gcc-help mailing list