Re: SpinLock/Mutex : Difference ?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"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@xxxxxxxxxxxxxxxxxxxxxxx
FYI 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.

[...]

.



Relevant Pages

  • Re: password protected .pst files...
    ... Well the real issue is that I would like to be able to lock the files again ... click cancel. ... do you know of a way to lock the PST files again after ... and click on one of the archives, ...
    (microsoft.public.outlook)
  • Re: can the ENTER key be simulated in an ISPF panel
    ... can the ENTER key be simulated in an ISPF panel ... Then you should try "CONTROL DISPLAY LOCK" ... send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO ... Search the archives at http://bama.ua.edu/archives/ibm-main.html ...
    (bit.listserv.ibm-main)
  • Re: SpinLock/Mutex : Difference ?
    ... I does assume that either the set of all threads that will access the lock is known beforehand, or that a new thread must register itself, and wait for a sequence point to inject its new lock, before accessing the object for the first time. ... The best attribute is that reader acquisition when uncontended by writers requires only a single atomic increment. ... a minimal implementation can be created with three volatile long variable in less than 50 lines of code so the APIs provided by MS are almost redundant ... 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. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: [SLE] ATI Radeon Drivers problem
    ... mike wrote: ... > Mine doesn't lock up, but takes a bit more time than the original. ... Also check the archives at http://lists.suse.com ... Please read the FAQs: suse-linux-e-faq@suse.com ...
    (SuSE)
  • Re: [kde-linux] Konqueror 3.5.1 locks up
    ... On Sunday 25 June 2006 10:54, Pollywog wrote: ... but Firefox does not lock up. ... Archives: http://lists.kde.org/. ... normal lock up though, since it doesn't block the UI. ...
    (KDE)