This is the mail archive of the
mailing list for the pthreas-win32 project.
RE: Good Algorithm for "Multiple Readers"/"Multiple Writers"
- From: "Evstiounin, Mikhail" <Mikhail dot Evstiounin at ca dot com>
- To: "Stephen Croall" <scroall at tibco dot com>, <pthreads-win32 at sources dot redhat dot com>
- Date: Thu, 8 Dec 2005 09:01:55 -0500
- 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.
[mailto:email@example.com] On Behalf Of Stephen Croall
Sent: Thursday, December 08, 2005 4:57 AM
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.
From: Rustam T. Usmanov [mailto:firstname.lastname@example.org]
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
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 <URL:http://www.unilib.neva.ru/olsc/>