delorie.com/archives/browse.cgi | search |
X-Recipient: | archive-cygwin AT delorie DOT com |
DomainKey-Signature: | a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id |
:list-unsubscribe:list-subscribe:list-archive:list-post | |
:list-help:sender:subject:to:references:from:message-id:date | |
:mime-version:in-reply-to:content-type | |
:content-transfer-encoding; q=dns; s=default; b=w2dN0vJhIujlR9S+ | |
s2AqbkQwUaK7jd5yPR+m2S21lNScaPZzx2t+6kYXLzfv08QCnY/bjmUb7ngwH4a7 | |
fjo01dEKexZt1hmfENWWnsYkuwxeTR7Pvnqi2Gu7I/Pv9G2p0ZZ8drPW5sjpPqb3 | |
u6kIMutL0JGkfh93j/M39E9b8aA= | |
DKIM-Signature: | v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id |
:list-unsubscribe:list-subscribe:list-archive:list-post | |
:list-help:sender:subject:to:references:from:message-id:date | |
:mime-version:in-reply-to:content-type | |
:content-transfer-encoding; s=default; bh=vaPknDYS+BVfR2mn4OTACO | |
rwsEE=; b=XXOi1AdX1JqdKPF2RJXqUNmzSdWn1QbMYcs3BuIuAsRzyYUvLAYIkn | |
Kr8ZgCM7cHRFaVPe6aplUwEAnZICaWbN8RCnNIEWWcOGrM8TAoQ02kIsL/Cd39/L | |
VE2GXfieK3yzPZXsaipVyEFrAbvtj2jldtVvZhN9GPAOv4tCtyTJg= | |
Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
List-Id: | <cygwin.cygwin.com> |
List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
List-Archive: | <http://sourceware.org/ml/cygwin/> |
List-Post: | <mailto:cygwin AT cygwin DOT com> |
List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs> |
Sender: | cygwin-owner AT cygwin DOT com |
Mail-Followup-To: | cygwin AT cygwin DOT com |
Delivered-To: | mailing list cygwin AT cygwin DOT com |
Authentication-Results: | sourceware.org; auth=none |
X-Virus-Found: | No |
X-Spam-SWARE-Status: | No, score=-1.3 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 |
X-HELO: | m0.truegem.net |
Subject: | Re: Cygwin multithreading performance |
To: | cygwin AT cygwin DOT com |
References: | <CABPLASTtRK4mNxh0M_AnZgjJQ15kWPx+L=U=VCU3Wwi7jV_57A AT mail DOT gmail DOT com> <564E3017 DOT 90205 AT maxrnd DOT com> <CABPLASTLrH_udLuu2F-m5P6dkENW1Z4YHEudp4NG0-FGLJgPMg AT mail DOT gmail DOT com> <5650379B DOT 4030405 AT maxrnd DOT com> <20151121105301 DOT GE2755 AT calimero DOT vinschen DOT de> <5652C402 DOT 7040006 AT maxrnd DOT com> <24780-1448274431-7444 AT sneakemail DOT com> <5653B52B DOT 5000804 AT maxrnd DOT com> <20151126093427 DOT GJ2755 AT calimero DOT vinschen DOT de> <5656DDEF DOT 9070603 AT maxrnd DOT com> <5662C199 DOT 7040906 AT maxrnd DOT com> <CABPLAST5EnifrAQ2xKZmohKhyxQHh=K3x3DeCL+BTdHN8nN98w AT mail DOT gmail DOT com> |
From: | Mark Geisert <mark AT maxrnd DOT com> |
Message-ID: | <566367C8.5020703@maxrnd.com> |
Date: | Sat, 5 Dec 2015 14:40:08 -0800 |
User-Agent: | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39 |
MIME-Version: | 1.0 |
In-Reply-To: | <CABPLAST5EnifrAQ2xKZmohKhyxQHh=K3x3DeCL+BTdHN8nN98w@mail.gmail.com> |
Kacper Michajlow wrote: > 2015-12-05 11:51 GMT+01:00 Mark Geisert <mark AT maxrnd DOT com>: >> Mark Geisert wrote: >> In the OP's very good testcase the most heavily contended locks, by far, are >> those internal to git's builtin/pack-objects.c. I plan to show actual stats >> after some more cleanup, but I did notice something in that git source file >> that might explain the difference between Cygwin and MinGW when running this >> testcase... >> >> #ifndef NO_PTHREADS >> >> static pthread_mutex_t read_mutex; >> #define read_lock() pthread_mutex_lock(&read_mutex) >> #define read_unlock() pthread_mutex_unlock(&read_mutex) >> >> static pthread_mutex_t cache_mutex; >> #define cache_lock() pthread_mutex_lock(&cache_mutex) >> #define cache_unlock() pthread_mutex_unlock(&cache_mutex) >> >> static pthread_mutex_t progress_mutex; >> #define progress_lock() pthread_mutex_lock(&progress_mutex) >> #define progress_unlock() pthread_mutex_unlock(&progress_mutex) >> >> #else >> >> #define read_lock() (void)0 >> #define read_unlock() (void)0 >> #define cache_lock() (void)0 >> #define cache_unlock() (void)0 >> #define progress_lock() (void)0 >> #define progress_unlock() (void)0 >> >> #endif >> >> Is it possible the MinGW version of git is compiled with NO_PTHREADS >> #defined? If so, it would mean there's no locking being done at all and >> would explain the faster execution and near 100% CPU utilization when >> running under MinGW. > > Nah, there is no threading enabled when there is no pthreads. How > would that work? :D See thread-utils.h > > #ifndef NO_PTHREADS > #include <pthread.h> > > extern int online_cpus(void); > extern int init_recursive_mutex(pthread_mutex_t*); > > #else > > #define online_cpus() 1 > > #endif We're not familiar at all with MinGW. Could you locate the source for MinGW's pthread_mutex_lock() online and give us a link to it? And BTW, which Windows are you running and on what kind of hardware (bitness and #CPUS/threads)? It looks like we're going to have to compare actual pthread_mutex_lock() implementations. Inspecting source is nice but I don't want to be chasing a mirage so I really hope there's a pthread_mutex_lock() function inside the MinGW git you are running. gdb could easily answer that question. Could you please do an 'info func pthread_mutex_lock' after starting MinGW git under MinGW gdb with a breakpoint at main() (so libraries are loaded). ..mark -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |