Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #3872 > unrolled thread
| Started by | aminer <aminer@toto.net> |
|---|---|
| First post | 2013-10-07 20:07 -0700 |
| Last post | 2013-10-07 20:35 -0700 |
| Articles | 3 — 1 participant |
Back to article view | Back to comp.programming
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
| From | aminer <aminer@toto.net> |
|---|---|
| Date | 2013-10-07 20:07 -0700 |
| Subject | About Lockfree... |
| Message-ID | <l2viao$psq$1@news.albasani.net> |
Hello, 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 and this is not good at all, so what i will advice is to wrap those push() and pop() of your FIFO queue with a Lock 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 are FIFO fair and better for realtime systems. Thank you, Amine Moulay Ramdane.
[toc] | [next] | [standalone]
| From | aminer <aminer@toto.net> |
|---|---|
| Date | 2013-10-07 20:14 -0700 |
| Message-ID | <l2viob$2e9$1@news.albasani.net> |
| In reply to | #3872 |
I wrote: > so what i will advice is to wrap those push() and pop() of your FIFO > queue with a Lock 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 are FIFO fair and better for > realtime systems. And it's better to use two Locks , one for the push() and one for the pop(). Thank you, Amine Moulay Ramdane. On 10/7/2013 8:07 PM, aminer wrote: > > Hello, > > 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 and this is not good at all, > so what i will advice is to wrap those push() and pop() of your FIFO > queue with a Lock 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 are FIFO fair and better for > realtime systems. > > > > Thank you, > Amine Moulay Ramdane. > >
[toc] | [prev] | [next] | [standalone]
| From | aminer <aminer@toto.net> |
|---|---|
| Date | 2013-10-07 20:35 -0700 |
| Message-ID | <l2vjuh$4ii$1@news.albasani.net> |
| In reply to | #3872 |
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.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.programming
csiph-web