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


Groups > comp.programming.threads > #1865

Re: About Lockfree...

From aminer <aminer@toto.net>
Newsgroups comp.programming.threads, comp.programming
Subject Re: About Lockfree...
Date 2013-10-07 20:35 -0700
Organization albasani.net
Message-ID <l2vjuh$4ii$1@news.albasani.net> (permalink)
References <l2viao$psq$1@news.albasani.net>

Cross-posted to 2 groups.

Show all headers | View raw


On 10/7/2013 8:07 PM, aminer wrote:
> We have to be smart please, there are those that
> like Lockfree algorithms, but in my opinion those
> lockfree algorithms have an important weakness, in high contention
> scenarios they  will higher the cache-coherence traffic
> so they will slow the things, in worst scenarios you can
> have 1+2+3+4+ ..N = ((N^2+N)/2) or even worse N+N+N+N...N = N^2
> cache lines transfers from the memory


Those lockfree FIFO queue algorthms higher the cache-coherency traffic 
when there is contention, in worst scenarios you can
have 1+2+3+4+ ..N = ((N^2+N)/2) or even worse N+N+N+N...N = N^2
cache lines transfers from the memory and those Lockfree FIFO queue
algotithms are not FIFO fair , hence you can also have starvation with 
Lockfree FIFO queue algorithms, and this is not good at all,
so what i will advice is to wrap those push() and pop() of your FIFO 
queue with two Locks that supports FIFO fairness and that lower the 
cache-coherence traffic, this is better i think, so you can use for 
example the Scalable Anderson Lock , the scalable MCS Lock or my 
scalable distributed Lock for that , those Locks lower the 
cache-coherence traffic and are FIFO fair , so they avoid starvation and
are better for realtime systems.




Amine Moulay Ramdane.

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


Thread

About Lockfree... aminer <aminer@toto.net> - 2013-10-07 20:07 -0700
  Re: About Lockfree... aminer <aminer@toto.net> - 2013-10-07 20:14 -0700
  Re: About Lockfree... aminer <aminer@toto.net> - 2013-10-07 20:35 -0700

csiph-web