Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Mon, 24 Oct 2005 15:40:40 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: Scalability problem with Pthread Read/Write Locks Message-ID: <20051024134040.GD24278@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <20051023124539 DOT 21428 DOT qmail AT web32008 DOT mail DOT mud DOT yahoo DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20051023124539.21428.qmail@web32008.mail.mud.yahoo.com> User-Agent: Mutt/1.4.2i On Oct 23 05:45, Johan De Taeye wrote: > > My multi-threaded application is creating a lot of > pthread_rwlock objects to protect access to my objects. > I am noticing that this doesn't scale up well. As the number > of active objects being created/changed/deleted increases > into the thousands, the runtime performance degrades very > badly. > > When investigating the problem I noticed from the source code > in the files winsup/cygwin/thread.h and > winsup/cygwin/thread.cc that a static double-linked list > (called rwlocks) is used to keep track of all rwlocks present > in the process. Removal of an element in the list is O(n) and > explains the behavior of my application. > > When compiling under Linux no such scalability problems are > found. (I believe the pthreads implementation there doesn't > need to keep track of the active rwlocks) > > Finally the question: Could/should the =list= data structure > be replaced with a =set= to provide better scalability? Maybe, but http://cygwin.com/acronyms/#SHTDI. A patch which optimizes cases like this are always thoughtfully considered. If you're willing to help, have a look on http://cygwin.com/contrib.html. However, I'd think we shouldn't change this for the upcoming 1.5.19 release which already contains a lot more changes than we had in mind once. Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader cygwin AT cygwin DOT com Red Hat, Inc. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/