From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Sixt Subject: Re: [PATCH 2/2] pack-objects: fix threaded load balancing Date: Thu, 13 Dec 2007 08:15:16 +0100 Message-ID: <4760DC04.6080402@viscovery.net> References: <475EC2AB.60702@viscovery.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Junio C Hamano , git@vger.kernel.org, Jon Smirl To: Nicolas Pitre X-From: git-owner@vger.kernel.org Thu Dec 13 08:17:02 2007 Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1J2iJZ-0002Ht-IY for gcvg-git-2@gmane.org; Thu, 13 Dec 2007 08:17:01 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761172AbXLMHPT (ORCPT ); Thu, 13 Dec 2007 02:15:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1763029AbXLMHPS (ORCPT ); Thu, 13 Dec 2007 02:15:18 -0500 Received: from lilzmailso01.liwest.at ([212.33.55.23]:8611 "EHLO lilzmailso01.liwest.at" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762818AbXLMHPP (ORCPT ); Thu, 13 Dec 2007 02:15:15 -0500 Received: from cm56-163-160.liwest.at ([86.56.163.160] helo=linz.eudaptics.com) by lilzmailso01.liwest.at with esmtpa (Exim 4.66) (envelope-from ) id 1J2iI6-0001fi-8K; Thu, 13 Dec 2007 08:15:30 +0100 Received: from [127.0.0.1] (J6T.linz.viscovery [192.168.1.42]) by linz.eudaptics.com (Postfix) with ESMTP id 5129269F; Thu, 13 Dec 2007 08:15:10 +0100 (CET) User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) In-Reply-To: X-Enigmail-Version: 0.95.5 X-Spam-Score: 1.7 (+) X-Spam-Report: ALL_TRUSTED=-1.8, BAYES_99=3.5 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Nicolas Pitre schrieb: > On Tue, 11 Dec 2007, Johannes Sixt wrote: > >> Nicolas Pitre schrieb: >>> @@ -1612,10 +1620,10 @@ static void *threaded_find_deltas(void *arg) >>> pthread_mutex_lock(&data_ready); >>> pthread_mutex_unlock(&data_request); >>> >>> - if (!me->list_size) >>> + if (!me->remaining) >>> return NULL; >>> >>> - find_deltas(me->list, me->list_size, >>> + find_deltas(me->list, &me->remaining, >>> me->window, me->depth, me->processed); >>> } >>> } >> This hunk caught my attention. &data_ready is locked, but not released in >> this function. >> >> Looking more closely at the code surrounding this hunk, it seems that the >> lock is released in a *different* thread than the one that locked it. This >> works on Linux, but is not portable. We will have to use condition variables >> like every one else does in a producer-consumer-like scenario. > > Are you willing to make a patch for it? I'm working on it, slowly. -- Hannes