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


Groups > comp.programming.threads > #1925

Spinlock and lockfree and waitfree...

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 Spinlock and lockfree and waitfree...
Date Tue, 15 Oct 2013 20:03:32 -0700
Organization albasani.net
Lines 40
Message-ID <l3kl4m$ioi$1@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 n6jB6QmTjCcBuphNmHEh0wwA1y2PP79WbNH67WzbVazGPLX/ogP5HsxojKUiPTNJg0P3c9o5l8sUFgKUwjybAQP5NxRCAdCmCTUy4uUHWe7qafDvZWW/T9HBihinXagv
NNTP-Posting-Date Wed, 16 Oct 2013 00:03:34 +0000 (UTC)
Injection-Info news.albasani.net; logging-data="G3t28FbgFhArwfCOZVv9UUEaEqT64NpGsa624IL7hDKELuzzrYtSrGgIYopHCHyG59MRyQoITUIVuqQ8+1g4BZzKAgUEjzokoDbiJVMXWE0q3yIz946pVGt8xKgFfNXq"; mail-complaints-to="abuse@albasani.net"
User-Agent Mozilla/5.0 (Windows NT 6.0; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.0.1
Cancel-Lock sha1:7CjjhRhp3wTGuBz6CENkQjYkwyE=
Xref csiph.com comp.programming.threads:1925 comp.programming:3937

Cross-posted to 2 groups.

Show key headers only | View raw


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 | NextNext in thread | Find similar | Unroll thread


Thread

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