From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.93; helo=mga11.intel.com; envelope-from=yunhuax.feng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0EB4B2236BA8B for ; Tue, 9 Jan 2018 02:33:05 -0800 (PST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jan 2018 02:38:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,335,1511856000"; d="dat'59?scan'59,208,59";a="8649455" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by fmsmga002.fm.intel.com with ESMTP; 09 Jan 2018 02:38:15 -0800 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 9 Jan 2018 02:38:15 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 9 Jan 2018 02:38:14 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.189]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.159]) with mapi id 14.03.0319.002; Tue, 9 Jan 2018 18:38:12 +0800 From: "Feng, YunhuaX" To: "edk2-devel@lists.01.org" CC: "Feng, YunhuaX" , "Zhu, Yonghong" , "Gao, Liming" Thread-Topic: [PATCH 1/2] BaseTools: Enable MAX_CONCURRENT_THREAD_NUMBER = 0 feature Thread-Index: AdOJMImhaWLR+a38QvOpLlnn1UA1Gg== Date: Tue, 9 Jan 2018 10:38:12 +0000 Message-ID: <47C64442C08CCD4089DC43B6B5E46BC48192EB@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: <47C64442C08CCD4089DC43B6B5E46BC48192EB@shsmsx102.ccr.corp.intel.com> x-originating-ip: [10.239.127.40] MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 09 Jan 2018 03:09:43 -0800 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 Subject: [PATCH 1/2] BaseTools: Enable MAX_CONCURRENT_THREAD_NUMBER = 0 feature X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jan 2018 10:33:05 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable when set 'MAX_CONCURRENT_THREAD_NUMBER=3D0', will auto-detect number of pr= ocessor threads for MAX_CONCURRENT_THREAD_NUMBER Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=3D775 Cc: Liming Gao Cc: Yonghong Zhu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yunhua Feng --- BaseTools/Source/Python/build/build.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git BaseTools/Source/Python/build/build.py BaseTools/Source/Python/b= uild/build.py index 38498046d7..de19756d99 100644 --- BaseTools/Source/Python/build/build.py +++ BaseTools/Source/Python/build/build.py @@ -2,7 +2,7 @@ # build a platform or a module # # Copyright (c) 2014, Hewlett-Packard Development Company, L.P.
-# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions of the B= SD License @@ -26,6 +26,7 @@ import platform import traceback import encodings.ascii import itertools +import multiprocessing from struct import * from threading import * @@ -936,7 +937,10 @@ class Build(): self.ThreadNumber =3D int(self.ThreadNumber, 0) if self.ThreadNumber =3D=3D 0: - self.ThreadNumber =3D 1 + try: + self.ThreadNumber =3D multiprocessing.cpu_count() + except (ImportError, NotImplementedError): + self.ThreadNumber =3D 1 if not self.PlatformFile: PlatformFile =3D self.TargetTxt.TargetTxtDictionary[DataType.T= AB_TAT_DEFINES_ACTIVE_PLATFORM] -- 2.12.2.windows.2