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


Groups > comp.programming > #3796 > unrolled thread

The problem with a Spinlock...

Started byaminer <aminer@toto.net>
First post2013-09-24 21:36 -0700
Last post2013-09-24 21:46 -0700
Articles 2 — 1 participant

Back to article view | Back to comp.programming


Contents

  The problem with a Spinlock... aminer <aminer@toto.net> - 2013-09-24 21:36 -0700
    Re: The problem with a Spinlock... aminer <aminer@toto.net> - 2013-09-24 21:46 -0700

#3796 — The problem with a Spinlock...

Fromaminer <aminer@toto.net>
Date2013-09-24 21:36 -0700
SubjectThe problem with a Spinlock...
Message-ID<l1teo2$bdk$4@news.albasani.net>
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 if 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.


[toc] | [next] | [standalone]


#3797

Fromaminer <aminer@toto.net>
Date2013-09-24 21:46 -0700
Message-ID<l1tfag$c4m$1@news.albasani.net>
In reply to#3796
I correct a typo, please read again:

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 if 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, but 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.


[toc] | [prev] | [standalone]


Back to top | Article view | comp.programming


csiph-web