Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming.threads > #1925
| From | aminer <aminer@toto.net> |
|---|---|
| Newsgroups | comp.programming.threads, comp.programming |
| Subject | Spinlock and lockfree and waitfree... |
| Date | 2013-10-15 20:03 -0700 |
| Organization | albasani.net |
| Message-ID | <l3kl4m$ioi$1@news.albasani.net> (permalink) |
Cross-posted to 2 groups.
Hello, I have come to an interresting subject, and you have to be smart to understand it more... If you take a look at the following FIFO queue that is waitfree on the push() side and lockfree on the pop() side, here it's: http://pastebin.com/f72cc3cc1 as i said before , there is a weaknesses with this FIFO queue, first the lockfree side on the pop() is not FIFO fair , so it's not starvation-free on the pop() side, and there is a second weakness: it doesn't minimizes the cache-coherence traffic , but there is also a third weakness with this algorithm: since you can not use an exponential backoff on the waitfree pop() side you can not make it 4 times or 6 times faster under contention on the push() side, the Spinlock() with an exponential backoff mechanism on the pop() and the push() is 4 times to 6 times faster than the lockfree version and the waitfree version without a backoff mechanism and i have just explain it to you, but you can add an exponential backoff on the pop() lockfree side of this FIFO que, and this will make it 6 times faster under contention on the pop() side. So in my opinion , since the Spinlock with an exponential backoff is 6 times faster under contention , so the risk of a stavartion will be lowered, and since it minimizes the cache-coherence traffic, so this will make the Spinlock with an exponential backoff a better alternative if you want better speed and to minimize cache-coherence traffic. Thank you, Amine Moulay Ramdane.
Back to comp.programming.threads | Previous | Next — Next in thread | Find similar
Spinlock and lockfree and waitfree... aminer <aminer@toto.net> - 2013-10-15 20:03 -0700 Re: Spinlock and lockfree and waitfree... aminer <aminer@toto.net> - 2013-10-15 21:35 -0700 Re: Spinlock and lockfree and waitfree... "Chris M. Thomasson" <no@spam.invalid> - 2013-10-17 17:10 -0700
csiph-web