Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming.threads > #1752
| 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 | Re: About lockfree queues ... |
| Date | Tue, 24 Sep 2013 21:34:06 -0700 |
| Organization | albasani.net |
| Lines | 77 |
| Message-ID | <l1teir$bdk$1@news.albasani.net> (permalink) |
| References | <l1t6hd$2pr$1@news.albasani.net> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.albasani.net eJNyTqV4UcWlTKwx2SkudnNU6Z6hF0TVScNPk1OJ1tK+uJLNp+FL+7dCgkweKoJuwqtYfEM/gb5gZGcSufGMYfr645h4M1+JksnylqPC9TF8TvwCkvn1TEXKyBeWhxI7 |
| NNTP-Posting-Date | Wed, 25 Sep 2013 01:34:19 +0000 (UTC) |
| Injection-Info | news.albasani.net; logging-data="+DDoi/QYA0rTUqr10ymZwlkSGAPbdWqjfLeZjmIqQoEbGd0bFXV/aFCaI6jlFkqXHfcSCc4ourT0cfcMpIbWBXCqw7fkLmUqnnEjnAs/t18xeAuEIlMvAFqG9cLjwWHD"; 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 |
| In-Reply-To | <l1t6hd$2pr$1@news.albasani.net> |
| Cancel-Lock | sha1:EZVuF5ULLSK9Mbwv+EV9RrSytOc= |
| Xref | csiph.com comp.programming.threads:1752 comp.programming:3795 |
Cross-posted to 2 groups.
Show key headers only | View raw
Hello, That's not the end of the story, there is still a problem with the Spinlock with an exponential backoff, i think you have to undertand something important, the backoff mechanism has to be set correctly to lower the cache-coherence traffic, but how to set it correctly ? cause the locked region has a variable size , so of for example your locked region takes much more time and it's bigger you have to set the backoff mechanism with the PAUSE asm instruction(followed by a sleep(0)) correctly so that it will be bigger than what it takes to execute the locked region , so this is the problem with the Spinlocks with backoff , so how can we you do that efficiently? that's the big question ! and i think it's not easy to do it, for the lockfree queues, the time to execute a CAS is already known, so you can set the backoff mechanism of the lockfree queue correctly so that it become efficient under high contention. Thank you, Amine Moulay Ramdane. On 9/24/2013 7:16 PM, aminer wrote: > Hello, > > > I have wrote before this: > > "I have come to an interresting subject about lockfree queues, > if you take a look at those lockfree queues, like in transactional > memory, if the data have changed those lockfree queue retries and loop > again, but this (lockfree) mechanism generates a lot of cache-coherence > traffic, so i will not advice this lockfree mechanism, so how > can we do it ? you can take a look at the MCS queue Lock , i > think they are doing it like a waitfree linklist that doesn't spin and > that reduces a lot the cache-coherence traffic, other than that > if your memory manager is not optimal and uses a lockfree mechanism and > generates a lot cache-coherence traffic, so you have to use a freelist > to lower the cache coherence traffic." > > > But you have to know even that you are using spin waits inside lockfree > algorithms that genrates a lot of cache-coherence traffic , you have > to know that you can avoid this problem and make your lockfree queue > more efficient by adding an exponential backoff to you lockfree > mechanism using a PAUSE asm instruction followed by a Sleep(0) to not > freeze the computer and this way , like with the Spinlock, it will > reduce the cache-coherence traffic and make your lockfree queue more > efficient,. > > > > > Thank you, > Amine Moulay Ramdane. >
Back to comp.programming.threads | Previous | Next — Previous in thread | Find similar
About lockfree queues ... aminer <aminer@toto.net> - 2013-09-24 19:16 -0700 Re: About lockfree queues ... aminer <aminer@toto.net> - 2013-09-24 21:09 -0700 Re: About lockfree queues ... aminer <aminer@toto.net> - 2013-09-24 21:34 -0700
csiph-web