From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7914 invoked by alias); 8 Dec 2005 14:09:42 -0000 Received: (qmail 7899 invoked by uid 22791); 8 Dec 2005 14:09:41 -0000 X-Spam-Check-By: sourceware.org Received: from outhub4.tibco.com (HELO outhub4.tibco.com) (63.100.100.170) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 08 Dec 2005 14:09:39 +0000 Received: from na-h-inhub2.tibco.com (tibco-5.tibco.com [63.100.100.5]) by outhub4.tibco.com (8.12.10/8.12.9) with ESMTP id jB8E8AGL026909; Thu, 8 Dec 2005 06:08:10 -0800 (PST) Received: from NA-PA-VBE01.na.tibco.com (na-pa-be01.tibco.com [10.106.136.121]) by na-h-inhub2.tibco.com (8.12.10/8.12.10) with ESMTP id jB8E89nh015550; Thu, 8 Dec 2005 06:08:09 -0800 (PST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Good Algorithm for "Multiple Readers"/"Multiple Writers" Date: Thu, 08 Dec 2005 14:09:00 -0000 Message-ID: From: "Stephen Croall" To: "Evstiounin, Mikhail" , 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: 2005/txt/msg00132.txt.bz2 =20 We already use read/write locks in places but for greater parallelism multiple reader and multiple writer locks would be better. The current read/write lock implementation in POSIX doesn't support multiple writers. Only one writer thread can process at a time - as I would expect. I'm after a good model for writing a "many readers"/"many writers" lock implementation, which is portable from Windows to UNIX. Steve. -----Original Message----- From: Evstiounin, Mikhail [mailto:Mikhail.Evstiounin@ca.com]=20 Sent: 08 December 2005 14:02 To: Stephen Croall; pthreads-win32@sources.redhat.com Subject: RE: Good Algorithm for "Multiple Readers"/"Multiple Writers" I did not quite get it. The difference between reader and writer is that reader locks out writer and lets other readers continue without waiting while writer acquire an exclusive lock. Multiple writers will have serialized access to a resource in any case. So, there no difference from this point of view between "one writer -- many readers" and "many writers -- many readers". So, if you are going to use FIFO (or you don't care -- I made an assumption that all requests for resource locking is based on FIFO which is not true, generally speaking) in terms of how to process request queue then posix approach is enough. -----Original Message----- From: pthreads-win32-owner@sourceware.org [mailto:pthreads-win32-owner@sourceware.org] On Behalf Of Stephen Croall Sent: Thursday, December 08, 2005 4:57 AM To: pthreads-win32@sources.redhat.com Subject: RE: Good Algorithm for "Multiple Readers"/"Multiple Writers" Thanks, but the POSIX read/write interface supports a single writer vs. multiple readers. I'm after multiple writers & readers i.e. multiple threads can perform writing but readers must wait and vice versa. Steve. -----Original Message----- From: Rustam T. Usmanov [mailto:rustam@unilib.neva.ru]=20 Sent: 08 December 2005 09:54 To: Stephen Croall Subject: Re: Good Algorithm for "Multiple Readers"/"Multiple Writers" On Thu, 8 Dec 2005, Stephen Croall wrote: > Is anyone aware of whether POSIX implements this type of lock? pthread_rwlock ? See http://www.opengroup.org/onlinepubs/009695399/functions/pthread_rwlock_i nit.html -- Rustam Usmanov, systems engineer Institute of Consortia Library Information Systems, St.Petersburg State Polytechnic University Address: 29, Politekhnitcheskaya str., St.Petersburg, 195251, Russia Tel/fax: +7 812 552 7654