From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9237 invoked by alias); 16 Oct 2006 13:16:19 -0000 Received: (qmail 9227 invoked by uid 22791); 16 Oct 2006 13:16:17 -0000 X-Spam-Check-By: sourceware.org Received: from smtpa1.aruba.it (HELO smtp2.aruba.it) (62.149.128.206) by sourceware.org (qpsmtpd/0.31) with SMTP; Mon, 16 Oct 2006 13:16:05 +0000 Received: (qmail 19703 invoked by uid 89); 16 Oct 2006 13:15:59 -0000 Received: by simscan 1.1.0 ppid: 19681, pid: 19694, t: 0.2103s scanners: clamav: 0.80/m:29/d:680 Received: from unknown (HELO ?192.168.2.2?) (catrauser/catrasoftware.it@87.5.55.200) by smtp2.aruba.it with SMTP; 16 Oct 2006 13:15:59 -0000 Message-ID: <453386EF.90503@catrasoftware.it> Date: Mon, 16 Oct 2006 13:16:00 -0000 From: Giuliano Catrambone User-Agent: Thunderbird 1.5.0.5 (X11/20060808) MIME-Version: 1.0 To: pthreads-win32@sources.redhat.com Subject: Re: Windows process very slow using more than one condition variable References: <452FFFF7.20005@catrasoftware.it> In-Reply-To: <452FFFF7.20005@catrasoftware.it> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Rating: smtp2.aruba.it 1.6.2 0/1000/N X-IsSubscribed: yes Mailing-List: contact pthreads-win32-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sourceware.org X-SW-Source: 2006/txt/msg00053.txt.bz2 Hi all, I investigated more the problem and it looks that the pthread_cond_timedwait never respect the timeout I gave as input. I observed that also the Sleep Windows API never respect his arguments in millisecs. Do you know which could be the problem? Thanks giu Giuliano Catrambone wrote: > Hello guys > I have a program which is portable on windows and Linux and I'm > using pthread-win32 > for the Windows version. > > In my scenario I have one events queue and many threads acceding to > this queue > to get events (consumers) and to add events (producers). > > Every event has, as property, the consumer thread type addressee > which has to get the event. > > In my implementation I use as many condition variables as the > number of different cunsumer types. > > In this way, every time an event for the consumer X is added into > the queue, a pthread_cond_signal > is called on the condition variable where only the consumer X is in > timedwait. > > If I have only one consumer type, and then one condition variable, > the process on Windows is very fast > and works fine. > If I have more than one consumer types, and then more than one > condition variables, the process on Windows > is very slow. > BTW, the same code, on linux, works fine also with many consumer > types threads and then many condition variables. > > Do you have some ideas why Windows seems works very slow using more > than one condition variables? > Thanks > giu > -- ----------------------------------------------------------------- Giuliano Catrambone Director, Professional Services Open source projects: http://sourceforge.net/projects/catralibraries/ http://sourceforge.net/projects/openstreaming/ CatraSoftware: Home page: http://www.catrasoftware.it Streaming page: http://www.catrasoftware.it/Streaming/CatraStreamingPlatform.htm Mobile +39.393.8816655 Fixed: +39.02.90377228 Skype: Catrambone Giuliano msn: giulianocatrambone@hotmail.com Jabber: giuliano.catrambone@Jabber.org Yahoo: giuliano.catrambone -----------------------------------------------------------------