Boost logo

Boost Users :

Subject: [Boost-users] [thread] Stress testers sought for a new "Recursive MRSW" locking class TCLock
From: U.Mutlu (for-gmane_at_[hidden])
Date: 2011-11-25 17:42:57


Today I wrote a locking class for the "many readers/single writer, with recursion (MRSW-R)" - problem
(ie. shared recursive locking).
The current version is for Linux/Unix like systems only.
Anybody seriously interessted in stress testing / performance testing it
drop me a note.

This locker has automatic "Upgrade" (and also "Downgrade") feature built-in,
ie. nothing sepereate needed (see examples below).
It's just a small mutex class and one locker class which can do both
read and write locking (ie. just pass the kind via ctor-param...).
(of course one can derive seperate classes for Read and Write)
Of course it uses boost (especially atomic primitives like atomic_inc32(), atomic_dec32() etc.)

Examples:

TCLockVar LV; // this is our special mtx var

void f() // called from many threads
{
   TCLock L(LV); // a Read-Lock
   ...
}

void g() // called from many threads
{
   TCLock L(LV, true); // a Write-Lock
   ...
}

void h() // called from many threads
{
   TCLock L(LV); // a Read-Lock
   ...
   if (fNeedToUpdate)
   {
     TCLock L(LV, true); // a Write-Lock within a Read-Lock; that's OK! :-)
     ...
   }
   ...
}

Just drop me an email if interessted in stress testing TCLock.

--
U.Mutlu
www.mutluit.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net