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.43; helo=mga05.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 BC79B2035D315 for ; Thu, 11 Jan 2018 00:23:11 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Jan 2018 00:28:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,343,1511856000"; d="scan'208";a="192790356" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga005.jf.intel.com with ESMTP; 11 Jan 2018 00:28:24 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 11 Jan 2018 00:28:24 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.213]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.218]) with mapi id 14.03.0319.002; Thu, 11 Jan 2018 16:28:22 +0800 From: "Zhu, Yonghong" To: "Feng, YunhuaX" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Zhu, Yonghong" Thread-Topic: [PATCH 1/2] BaseTools: Enable MAX_CONCURRENT_THREAD_NUMBER = 0 feature Thread-Index: AdOJMImhaWLR+a38QvOpLlnn1UA1GgBhY/yg Date: Thu, 11 Jan 2018 08:28:21 +0000 Message-ID: References: <47C64442C08CCD4089DC43B6B5E46BC48192EB@shsmsx102.ccr.corp.intel.com> In-Reply-To: <47C64442C08CCD4089DC43B6B5E46BC48192EB@shsmsx102.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: Thu, 11 Jan 2018 08:23:12 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Yonghong Zhu =20 Best Regards, Zhu Yonghong -----Original Message----- From: Feng, YunhuaX=20 Sent: Tuesday, January 09, 2018 6:38 PM To: edk2-devel@lists.01.org Cc: Feng, YunhuaX ; Zhu, Yonghong ; Gao, Liming Subject: [PATCH 1/2] BaseTools: Enable MAX_CONCURRENT_THREAD_NUMBER =3D 0 f= eature 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.
-# C= opyright (c) 2007 - 2017, Intel Corporation. All rights reserved.
+# Copyright (c) 2007 - 2018, Intel Corporation. All rights=20 +reserved.
# # This program and the accompanying materials # are licensed and made a= vailable under the terms and conditions of the BSD License @@ -26,6 +26,7 @= @ import platform import traceback import encodings.ascii import itertoo= ls +import multiprocessing =20 from struct import * from threading import * @@ -936,7 +937,10 @@ class Build(): self.ThreadNumber =3D int(self.ThreadNumber, 0) =20 if self.ThreadNumber =3D=3D 0: - self.ThreadNumber =3D 1 + try: + self.ThreadNumber =3D multiprocessing.cpu_count() + except (ImportError, NotImplementedError): + self.ThreadNumber =3D 1 =20 if not self.PlatformFile: PlatformFile =3D self.TargetTxt.TargetTxtDictionary[DataType.T= AB_TAT_DEFINES_ACTIVE_PLATFORM] -- 2.12.2.windows.2