delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2023/09/02/23:51:23

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7FBBF3858CDA
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1693713081;
bh=gPvCdQLxhxXfmPOS7+6lRukevBTLdP4h/HzMthwk9DE=;
h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=fpjjOA0SQ0qJoH6QarroNkHti5r9PxxJNFPs/ZWLzQpiJFvE6S8oOH3onpY9xrnEB
kUJviUTdp9CJ8H2U9h3pYv9mCLuNqqvj9zoAdAh8daCaIw+tBrLS5AcBsaRPgOhrkn
3xhF0vF0YxSHaWMZGrbbImnBowHv0xwzd4cTE5zE=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1462D3858CD1
Subject: Re: posix thread scaling issue
To: cygwin AT cygwin DOT com
References: <550e8950-8f7a-4765-b23e-57d0e710fde0 AT jeffunit DOT com>
<2cfbcf8d-911f-a64b-8916-12b005c9f6f6 AT Shaw DOT ca>
<cf618819-c30c-439d-ad5f-54b2311bd936 AT jeffunit DOT com>
<07386659-68b3-a35d-1402-22684f8e5755 AT Shaw DOT ca>
Message-ID: <1a894e01-0dee-7a14-d94a-40034b88275f@maxrnd.com>
Date: Sat, 2 Sep 2023 20:50:36 -0700
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
Firefox/52.0 SeaMonkey/2.49.4
MIME-Version: 1.0
In-Reply-To: <07386659-68b3-a35d-1402-22684f8e5755@Shaw.ca>
X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, SPF_HELO_NONE, SPF_NONE,
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
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Mark Geisert via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Mark Geisert <mark AT maxrnd DOT com>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 3833pNLZ017303

Hi folks,

Brian Inglis via Cygwin wrote:
> On 2023-09-02 12:27, jeff via Cygwin wrote:
[...]
>> When I run cinebench, I can get to 100% cpu utulization (at around 3ghz) on 
>> windows.
> 
> Chances are the benchmark is designed to handle that:
> 
> "When the program is running inside the group, unless it is processor group aware, 
> then it can only access other threads in the same group. This means that if a 
> multi-threaded program can use 128 threads, if it isn’t built with processor 
> groups in mind, then it might only spawn with access to 64."
> 
> I also do not know how you would program for that in Cygwin to map onto the 
> equivalent Windows function required.
> 
> Perhaps one of the developers involved could comment here?

Cygwin doesn't know (at user level) about processor groups as that's a Windows 
construct.  Cygwin does know about processor affinity and treats all available 
processors as a contiguous set, like Linux does, up to 1024 in size.  One uses 
'taskset' from the util-linux package to assign processes to specific processor(s).

One can deal with thread affinity using pthread_get_affinity_np() and 
pthread_set_affinity_np() functions provided by the Cygwin DLL.  These are modeled 
after the same-named functions in Linux.  The internals of these functions do have 
to work within the Windows processor group constraints, so not all plausible 
set-affinity operations are allowed by Windows.  Briefly, you can't move a thread 
outside the processor group it's currently in; you have to move its process to the 
new group first.
HTH,

..mark

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019