From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11olkn20800.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eae::800]) by sourceware.org (Postfix) with ESMTPS id 39A753858CD1 for ; Sat, 2 Sep 2023 19:30:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 39A753858CD1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=hotmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=hotmail.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=njGuJ89Kxi8+y4dsbDgVwmbA8TjVhFRRl8CMuNYkUGCkayp9a627hCkXwrzGZ8ZPmXsZX9yL6eOwnd/f4DXqi5LMiy2HDXUfhMrbBuFT9m/xDUBza9yW7ujCBDr9GDPau7uUUh0ObaSuXhNvdvLCtHd5IuJf6QmDnVGIZR7YGntwrjY9/SpP4rHKoEZtzU0bRIUIXZuNjL3bkpJVTnJUwdXCsNgFL3FLc9wwgA7A/YDcwLQvXZK1/1a5YMIak/Q1Uza3fArx7l8DPDmo4Q/zkEMf5kvpFdBNuLl8QwLIOKcUKGdSEaZN24yOPnfPw6c7qJ9+6/YS90gqkpmGyHidjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=rqKkyH0tcT16hEznbXqT8RdpMlyzz6HxBgS6v++jXNI=; b=ayyqZFF/igLj8uJyYSLQPdl02Jn5GFosrwaORZACYeWZL6AEA8f9OTvEHGjr88onEz/u+YrwXFUg47s7uXcH56RV+TAde/Ur6neDnO5xSb8AJX9j1kjZogiB5Se2icXCW8Cy/DQHwkc5uV4o2kFf6ckYwuq3bDJ6g6a1Qmat75MPDpbIHnRBQo/Qa0Y3Lb+Ls7irUVTp9VdYHZKsGSjcmKJC42xp7KDOWxA1G6CceY/sCHAYbfejIy3EP1wabdIsylPuWBhZKQNHGV8z2MFBPon4pQMOKD1HHQIfW/USxqC3RWUM8jeMA2smsCFDlTA+1hieXrTubrfkOs7+Eskfrg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rqKkyH0tcT16hEznbXqT8RdpMlyzz6HxBgS6v++jXNI=; b=l5oiG05TC9eozf30gZyzjt0OocJfWsie41qxFs8Ga72m1Ue1djgJYxGGSaHHZllwMTX8Ghf5gmTrktmSdmUnd3wMz69DQ3UKH5JukQuaRyzFV/uzvAKUjiSKJERrmbsHuJWp+EBTHwNsns3sBk52t54vqKVK1WY/ugyNMCbjgFel4iUPNKCxDhAksc2+plwzdMA+TpZqyjAQ5b+NvO039kz9Wbs8ljwz5Y4M7wgyF/Aif74RGSJn/lkLDV37mzhcHLUmR/kSCmJjG9tTtKzrV73b2mZdA3AsepPBDz1nqZeGqLkeO2yhyOCHhuwBx+//OG0ga02MI7fc/UtdTa6tyA== Received: from SN7PR14MB7000.namprd14.prod.outlook.com (2603:10b6:806:2ed::10) by BY5PR14MB3543.namprd14.prod.outlook.com (2603:10b6:a03:1c5::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.30; Sat, 2 Sep 2023 19:30:16 +0000 Received: from SN7PR14MB7000.namprd14.prod.outlook.com ([fe80::c6b2:25b6:ca3a:69b7]) by SN7PR14MB7000.namprd14.prod.outlook.com ([fe80::c6b2:25b6:ca3a:69b7%3]) with mapi id 15.20.6699.034; Sat, 2 Sep 2023 19:30:16 +0000 From: =?iso-8859-1?Q?Andr=E9_Bleau?= To: "cygwin@cygwin.com" Subject: Re: posix thread scaling issue Thread-Topic: posix thread scaling issue Thread-Index: AQHZ3dPAE/RVWXqTpkamsR5tXy0XwA== Date: Sat, 2 Sep 2023 19:30:16 +0000 Message-ID: Accept-Language: fr-CA, en-US Content-Language: fr-CA X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-tmn: [adKNfCJoN4lkNNs+WZqkOzXBSBqHnW3l] x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SN7PR14MB7000:EE_|BY5PR14MB3543:EE_ x-ms-office365-filtering-correlation-id: 085b6a54-973b-4cfa-66ed-08dbabeb093f x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: HXT00/sAxjiIU6+3/waPfwq/zt5oRoh3bffwDCWOb/7IJ9jlv76vYz5yCE8piGD2B8mYYI2zyT5GQh1or1GziELsTcOd3nRTANjsKHiQisDIbHmvCBhTfcV8NcZxrtRv7RXsd16ycQcOJtX5ng1ZIhbZGnD3FpC/GAalEzl1rEmm4OxaYnnjfCc8tIr2aZ0BY2rZioiBZQTXLctnzlfDkgHCf9AH5GvwEJEeRCskn88k1sC6VNfnWrgl6NSEW4ev+AshjM7cQyl7E+2ip5dn8qfyzdkQdXEC925U1xlgpYJS65wAIleyjzFAjvmHm/dSCa+JoPoLXtJKaH4cHdn1H78J4oTBy+C9nd0BBpGasd4xT/WK7vcOhcNuxLAtps9IbDehTMYi+ZwL+211cO7rT2vRWeSIW6D/sADPlYMqbmvengm/IMya3ojmXUxH2y6pxkz2d8WUhUjXoBrd0HikHixejqxWi2bKhoJaGU7eKvkaZLr0ctedRWNXapLXbjjGeQT1rtu7kADI7gCrZBdI5OgQYthDV+OI1sYp+gFSF/vGcCB9vXVhcQhbu0n0/w/c x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?fcQCb120SmLhbzKMBihELmFTQDuhDtBjYVOouGHmAfz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ldN9+JYffa5X/6EJr0pfOJcNWGJATsr2IPYLMyxAE+s630jpH1VmMfPT6?= =?iso-8859-1?Q?kgtaDd1Azl6Tgh9q8/ZRMr9mFmIPUKCoPjs4jYS3EP0PDRDEF4XKAak1dW?= =?iso-8859-1?Q?xbMrlvNKNkMPighoyV2bdyJenFWix33m8+AHEq9G0z/QNk3LwNDXPtafaz?= =?iso-8859-1?Q?ZMJQwDA1ojC4NJQXiCeHjooZR2aEQRGxl3/dTy/Rex8DYalm7vmlh0Xdhc?= =?iso-8859-1?Q?/jgWwbpC4nLGKnbMejqrQKKhJIV5CkhcrNilcvLOWWujK2jSlB247HjMAX?= =?iso-8859-1?Q?Wz7mNPRYUeE+v10gocbVrJRcEasEvvSmg+UQJN1nKPTTQOIxAmr5Ar1tCC?= =?iso-8859-1?Q?VzouO6On+4dC08ILJqJQ=3D=3D?= Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-cd57b.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN7PR14MB7000.namprd14.prod.outlook.com X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 085b6a54-973b-4cfa-66ed-08dbabeb093f X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Sep 2023 19:30:16.3279 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR14MB3543 X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Jeff wrote:=0A= =0A= > I have a program that is embarrassing parallel.=0A= > On my older computer which has an epyc 7302 (16 cores, 32 threads) it=0A= > scales very well using cygwin, and fully utilized all threads.=0A= > On my new computer which has an epyc 7B13 (64 cores, 128 threads) it=0A= > does not scale very well.=0A= =0A= > According to the windows task manager, it only uses 74% of the cpu=0A= > resources.=0A= > The time it takes the program to run on windows is 166 seconds.=0A= > Using the same hardware on a recent version of linux, I can get 100% cpu= =0A= > utilization and the program takes 100 seconds to run.=0A= =0A= > I suspect there may be something in cygwin that doesn't scale well with= =0A= > lots of posix threads.=0A= > I know this is a bit of an unusual situation, but you can buy a 128 core= =0A= > / 256 thread system now.=0A= =0A= > Enclosed is the output of cygcheck.=0A= > I updated my version of cygwin to be current as of today, Sep 2 2023.=0A= =0A= > thanks,=0A= > jeff=0A= =0A= Hi Jeff,=0A= =0A= Cygwin's memory allocation, and anything that uses it under the hood, such = as some containers from the C++ standard library, don't scale well with man= y threads. I have observed even worse scalling than yours in my own massive= ly multi-thread programs.=0A= =0A= My advice would be to either rewrite your program to centralize memory allo= cation in a specialized thread that serves the other processing threads, or= , if you don't need Posix things, compile with the Mingw cross-compiler, wh= ich produces code that uses M$ implementation for memory allocation, which = scales better.=0A= =0A= Regards,=0A= =0A= - Andr=E9 Bleau=