From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 37438 invoked by alias); 5 Dec 2015 22:40:03 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 37425 invoked by uid 89); 5 Dec 2015 22:40:02 -0000 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 Received: from m0.truegem.net (HELO m0.truegem.net) (69.55.228.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Sat, 05 Dec 2015 22:40:00 +0000 Received: (from daemon@localhost) by m0.truegem.net (8.12.11/8.12.11) id tB5MdwgJ033190 for ; Sat, 5 Dec 2015 14:39:58 -0800 (PST) (envelope-from mark@maxrnd.com) Received: from 76-217-5-154.lightspeed.irvnca.sbcglobal.net(76.217.5.154), claiming to be "[192.168.1.100]" via SMTP by m0.truegem.net, id smtpdJHAjeB; Sat Dec 5 14:39:53 2015 Subject: Re: Cygwin multithreading performance To: cygwin@cygwin.com References: <564E3017.90205@maxrnd.com> <5650379B.4030405@maxrnd.com> <20151121105301.GE2755@calimero.vinschen.de> <5652C402.7040006@maxrnd.com> <24780-1448274431-7444@sneakemail.com> <5653B52B.5000804@maxrnd.com> <20151126093427.GJ2755@calimero.vinschen.de> <5656DDEF.9070603@maxrnd.com> <5662C199.7040906@maxrnd.com> From: Mark Geisert Message-ID: <566367C8.5020703@maxrnd.com> Date: Sat, 05 Dec 2015 22:40:00 -0000 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: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2015-12/txt/msg00057.txt.bz2 Kacper Michajlow wrote: > 2015-12-05 11:51 GMT+01:00 Mark Geisert : >> 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 > > 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