Hello,
If you take a look at the SpinLock that i am using
inside my SemaMonitor, it uses a backoff mechanism to be more efficient
but there is still a weakness with that SpinLock cause
all the threads inside this SpinLock spin on the same shared location
causing
cache-coherence traffic on every successful lock access so it will slow
globally the threads of your computer, so the idea is to use like an MCS
queue Lock that uses
an exponential backoff and that doesn't spin on a shared variable but
local variables.
I am not the designer of this SpinLock, this SpinLock was designed by
other devellopers and it is not so efficient as i have just explained,
here is the
devellopers of this SpinLock (that i am using) called Istvan Agoston and
Primoz Gabrijelcic :
here
http://code.google.com/p/gpdelphiunits/source/browse/trunk/src/SpinLock.pas?r=37
So i will try to design something like an MCS queue lock that
is very efficient in the near future nad that i will use inside
my SemaCondvar and SemaMonitor.
Thank you,
Amine Moulay Ramdane.