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


Groups > comp.programming.threads > #1904

Cache-coherence traffic 1...

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.albasani.net!.POSTED!not-for-mail
From aminer <aminer@toto.net>
Newsgroups comp.programming.threads, comp.programming
Subject Cache-coherence traffic 1...
Date Fri, 11 Oct 2013 11:21:41 -0700
Organization albasani.net
Lines 64
Message-ID <l3952b$p4d$4@news.albasani.net> (permalink)
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Trace news.albasani.net CCCKwDP9vrty7bOOETzVmjR6NOBtKGl3SFZGQq8lDAPK+mKY8++H4PO/pptm7YiGQWqQnos8DNYemyx9tvo3AjKUDAqJ+c0Ry9Mm2ZoQM0OGfomoDZbdhVug2bdJhH6n
NNTP-Posting-Date Fri, 11 Oct 2013 15:21:47 +0000 (UTC)
Injection-Info news.albasani.net; logging-data="tiVUeZaHgevIx46x72/+g9Qu2lILgBW7zqWZRNg0zckIHMDG5b654BMeg/bgjWOeRsJsp/O6XrLWrFpU3XtS/zs+v98i1NdyfY8AkFR9rLovXZ1wpA1Idfx3+8D4C6+Y"; mail-complaints-to="abuse@albasani.net"
User-Agent Mozilla/5.0 (Windows NT 6.0; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
Cancel-Lock sha1:6PEadOS3yMh5u/7+jPe5R4dJS9c=
Xref csiph.com comp.programming.threads:1904 comp.programming:3917

Cross-posted to 2 groups.

Show key headers only | View raw


I correct some typos...

Hello,

I have come to an interresting subject, in computer science
we calculate the complexity to give an idea at how good
or bad is the algorithm, it's the same with Locks you have
to do some calculations with Locks algorithms to give an idea at how 
good or bad the Lock is with cache-coherence traffic, so follow with me
please, if you take a look at the source code of my
scalable distributed fair Lock (you can download the source
code at:  http://pages.videotron.com/aminer/)

You will read inside the LW_DFLOCK.pas right on the
"procedure TDFLOCK.Enter;" you will read this:

==

if ((FCount3^.FCount3=2) and CAS(FCount2.FCount2,1,0))
then
begin
  myobj^.myid:=-1;
  break;
end;"

==

If you have noticed if FCount2.FCount2 have changed this
will generate N  (N is the number of threads) cache lines misses
and cache lines transfers, but you have to be smart please ,
in a contention scenario since we are looping around:

"if ((FCount3^.FCount3=2) and (FCount1^[myid].FCount1=myobj^.count)) 
then break;"

and

FCount1^[myid].FCount1 is on the a local cache

that means that the cache-coherence traffic will be reduced to 1
cache misse and 1 cache line tranfer every time  FCount1^[myid].FCount1 
have changed , so this is better than
the cache-coherence traffic of 1+2+3...N = (N^2+N)/2 or even worse the 
N+N+N+...N of the spinlock with a backoff or the Ticket spinlock,
other than that my scalable distributed Lock is Fair and it avoids
starvation.




Thank you,
Amine Moulay Ramdane.











Back to comp.programming.threads | Previous | NextNext in thread | Find similar


Thread

Cache-coherence traffic 1... aminer <aminer@toto.net> - 2013-10-11 11:21 -0700
  Re: Cache-coherence traffic 1... aminer <aminer@toto.net> - 2013-10-11 11:29 -0700

csiph-web