This is the mail archive of the pthreads-win32@sourceware.org mailing list for the pthreas-win32 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Good Algorithm for "Multiple Readers"/"Multiple Writers"


The writers are writing to different items in a list i.e. different
areas of memory.  They are all independent writes.  Thread 1 writes to
item 1, thread 2 writes to item 2 etc...  They will never write to the
same memory.  However, I cannot have reads going on at the same time as
the writes, unless I use a read/write lock on every single item in the
list.

Steve. 


-- 

J. Senior Software Engineer, Tibco Software Ltd.
T. +44 (0) 1792 360773
M. +44 (0) 7788 971394
E. scroall@tibco.com
W. www.tibco.com

-----Original Message-----
From: Evstiounin, Mikhail [mailto:Mikhail.Evstiounin@ca.com] 
Sent: 08 December 2005 15:03
To: Stephen Croall; RKindred@SwRI.edu; pthreads-win32@sources.redhat.com
Subject: RE: Good Algorithm for "Multiple Readers"/"Multiple Writers"

Frankly, how do you think it is possible to be able to write to resource
in parallel and keep integrity of this resource all the time? There is a
reason why writer gains an exclusive lock on a resource. 

-----Original Message-----
From: pthreads-win32-owner@sourceware.org
[mailto:pthreads-win32-owner@sourceware.org] On Behalf Of Stephen Croall
Sent: Thursday, December 08, 2005 9:49 AM
To: RKindred@SwRI.edu; pthreads-win32@sources.redhat.com
Subject: RE: Good Algorithm for "Multiple Readers"/"Multiple Writers"


But that is for "single writer"/"multiple readers" - it doesn't support
multiple writers.

Steve.


-- 

J. Senior Software Engineer, Tibco Software Ltd.
T. +44 (0) 1792 360773
M. +44 (0) 7788 971394
E. scroall@tibco.com
W. www.tibco.com

-----Original Message-----
From: Robert Kindred [mailto:RKindred@SwRI.edu] 
Sent: 08 December 2005 14:47
To: Stephen Croall; pthreads-win32@sources.redhat.com
Subject: RE: Good Algorithm for "Multiple Readers"/"Multiple Writers"

I use the pthread_rwlock_t in pthreads-win32, and it works fine.

Robert Kindred

> -----Original Message-----
> From: pthreads-win32-owner@sourceware.org
> [mailto:pthreads-win32-owner@sourceware.org]On Behalf Of Stephen
Croall
> Sent: Thursday, December 08, 2005 3:10 AM
> To: pthreads-win32@sources.redhat.com
> Subject: Good Algorithm for "Multiple Readers"/"Multiple Writers"
> 
> 
> Hi,
> 
> I'm looking for a good, performant algorithm for "multiple
> reader"/"multiple writer" locking.
> 
> I'm in the process of writing my own but I would rather not fall into
> any common pitfalls, especially since performance & scalability are
> critical.
> 
> Is anyone aware of whether POSIX implements this type of lock?  I
can't
> seem to find any reference to it in the POSIX documentation.
> 
> Cheers, Steve.
> 
> -- 
> 
> J. Senior Software Engineer, Tibco Software Ltd.
> T. +44 (0) 1792 360773
> M. +44 (0) 7788 971394
> E. scroall@tibco.com
> W. www.tibco.com
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]