Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #3759 > unrolled thread

About my RWLock ...

Started byaminer <aminer@toto.net>
First post2013-09-22 23:13 -0700
Last post2013-09-22 23:47 -0700
Articles 4 — 1 participant

Back to article view | Back to comp.programming


Contents

  About my RWLock ... aminer <aminer@toto.net> - 2013-09-22 23:13 -0700
    Re: About my RWLock ... aminer <aminer@toto.net> - 2013-09-22 23:37 -0700
      Re: About my RWLock ... aminer <aminer@toto.net> - 2013-09-22 23:40 -0700
    Re: About my RWLock ... aminer <aminer@toto.net> - 2013-09-22 23:47 -0700

#3759 — About my RWLock ...

Fromaminer <aminer@toto.net>
Date2013-09-22 23:13 -0700
SubjectAbout my RWLock ...
Message-ID<l1obk6$kls$1@news.albasani.net>
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.


[toc] | [next] | [standalone]


#3760

Fromaminer <aminer@toto.net>
Date2013-09-22 23:37 -0700
Message-ID<l1od0r$l3j$1@news.albasani.net>
In reply to#3759


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.


On 9/22/2013 11:13 PM, aminer wrote:
>
> 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.
>
>
>

[toc] | [prev] | [next] | [standalone]


#3761

Fromaminer <aminer@toto.net>
Date2013-09-22 23:40 -0700
Message-ID<l1od71$l3j$4@news.albasani.net>
In reply to#3760
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.



Thank you,
Amine Moulay Ramdane.

[toc] | [prev] | [next] | [standalone]


#3762

Fromaminer <aminer@toto.net>
Date2013-09-22 23:47 -0700
Message-ID<l1odk8$2dp$1@news.albasani.net>
In reply to#3759
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.


Thank you,
Amine Moulay Ramdane.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.programming


csiph-web