Re: SpinLock/Mutex : Difference ?
- From: "Chris M. Thomasson" <no@xxxxxxxxxxxx>
- Date: Sun, 20 Dec 2009 23:02:24 -0800
"m" <m@xxx> wrote in message news:uKbFWtcgKHA.2104@xxxxxxxxxxxxxxxxxxxxxxx
"Chris M. Thomasson" <no@xxxxxxxxxxxx> wrote in message news:Z0_Wm.9220$ft1.2525@xxxxxxxxxxxxxxx"m" <m@xxx> wrote in message news:u1ahCxEgKHA.2780@xxxxxxxxxxxxxxxxxxxxxxxFYI reference implementations of shared reader, single writer locks are widely available on usernet - the archives of this NG have at least two threads on the topic and I am sure there is more out there.
IMHO, a minimal implementation can be created with three volatile long variable in less than 50 lines of code so the APIs provided by MS (AcquireSRWLockExclusive and friends) are almost redundant
http://msdn.microsoft.com/en-us/library/aa904937(VS.85).aspx
What implementation are you referring to?
It is a custom proprietary algorithm and I am not at liberty to reveal the source or owner.
Okay.
It is not a fair algorithm and guarantees only forward progress in a non-deterministic way. In practice, it works well for the specific job it was designed to do - guarding access by _many_ fast readers and _few_ slow writers to in memory indices for a data cache with remote coherency.
Have you tried out a distributed rw-mutex? The idea is simple in that each thread has a lock and read-access is comprised of a thread taking it's own lock. Write access is achieved when a thread takes all the locks.
[...]
.
- Follow-Ups:
- References:
- SpinLock/Mutex : Difference ?
- From: o0Zz
- Re: SpinLock/Mutex : Difference ?
- From: m
- Re: SpinLock/Mutex : Difference ?
- From: Daniel Terhell
- Re: SpinLock/Mutex : Difference ?
- From: o0Zz
- Re: SpinLock/Mutex : Difference ?
- From: Hugo gleaves
- Re: SpinLock/Mutex : Difference ?
- From: m
- Re: SpinLock/Mutex : Difference ?
- From: Chris M. Thomasson
- Re: SpinLock/Mutex : Difference ?
- From: m
- SpinLock/Mutex : Difference ?
- Prev by Date: Re: Problem with XP scheduler?
- Next by Date: Re: Problem with XP scheduler?
- Previous by thread: Re: SpinLock/Mutex : Difference ?
- Next by thread: Re: SpinLock/Mutex : Difference ?
- Index(es):
Relevant Pages
|