From 2f36fe438062801ca69785ffc8e476aa1bfa49e6 Mon Sep 17 00:00:00 2001 From: Torok Edwin Date: Fri, 19 Mar 2010 17:54:21 +0000 Subject: [PATCH] Set numThreads to 1 by default when Python is older than 2.5.2. Python 2.4 always hits this bug: http://bugs.python.org/issue1731717 when running check-lit on multi-core systems. Setting numThreads to 1 makes it slower, but at least the results reported are correct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98969 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/lit/lit/lit.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/utils/lit/lit/lit.py b/utils/lit/lit/lit.py index f1f19c4ddae..436f8e7a416 100755 --- a/utils/lit/lit/lit.py +++ b/utils/lit/lit/lit.py @@ -411,7 +411,14 @@ def main(): gSiteConfigName = '%s.site.cfg' % opts.configPrefix if opts.numThreads is None: - opts.numThreads = Util.detectCPUs() +# Python <2.5 has a race condition causing lit to always fail with numThreads>1 +# http://bugs.python.org/issue1731717 +# I haven't seen this bug occur with 2.5.2 and later, so only enable multiple +# threads by default there. + if sys.hexversion >= 0x2050200: + opts.numThreads = Util.detectCPUs() + else: + opts.numThreads = 1 inputs = args -- 2.34.1