Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

About my RWLock ...

2 views
Skip to first unread message

aminer

unread,
Sep 23, 2013, 2:13:15 AM9/23/13
to

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.



aminer

unread,
Sep 23, 2013, 2:37:04 AM9/23/13
to



Hello,

This SpinLock that i am using will not impact the performance of
my RWLock cause to use effectivly my RWLock there must be far less a
fewer number of writers than readers. But it will impact the performance
of my SemaCondVar and SemaMonitor, so i will design something that look
like an MCS queue Lock and that is
more efficient than this SpinLock with a backoff mechanism,
and as i said before we have to spin on local variables not on shared
variable and use a backoff mechanism this way our Lock will be
very efficient.


Thank you,
Amine Moulay Ramdane.


aminer

unread,
Sep 23, 2013, 2:40:22 AM9/23/13
to
On 9/22/2013 11:37 PM, aminer wrote:
> This SpinLock that i am using will not impact the performance of my RWLock.

i mean will not impact negatively the performance of my RWLock.

aminer

unread,
Sep 23, 2013, 2:47:24 AM9/23/13
to

I correct:

Hello,

This SpinLock that i am using will not impact negatively the performance of
my RWLock cause to use effectivly my RWLock there must be far less and
fewer number of writers than readers. But it will impact negatively when
there is high contention the performance of my SemaCondVar and
SemaMonitor, so i will design something that look like an MCS queue Lock
and that is
more efficient than this SpinLock with a backoff mechanism,
and as i said before we have to spin on local variables not on shared
variable and use a backoff mechanism this way our Lock will be
very efficient.


0 new messages