Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming.threads > #1861
| From | aminer <aminer@toto.net> |
|---|---|
| Newsgroups | comp.programming.threads, comp.programming |
| Subject | About my scalable distributed fair Lock 1... |
| Date | 2013-10-05 17:46 -0700 |
| Organization | albasani.net |
| Message-ID | <l2q19c$d7l$1@news.albasani.net> (permalink) |
Cross-posted to 2 groups.
Hello, We have to be smart, i have come to an interresting subject, if you want to add a backoff mechanism to the Ticket Lock , since the locked region can have a variable length, so it's not easy to come with a backoff mechanism that reduces efficiently the cache-coherence traffic, that's the same for a Spinlock with an exponential backoff , so how can we do it ? if you take a look at the source code of my scalable distributed fair lock you will notice that there is two place where i am using a Ticket mechanism , inside the LW_DFLOCK.pas and inside the FIFO queue inside the source code lockfree_mpmc.pas, but for the first Ticket mechanism that i am using inside LW_DFLOCK.pas we don't need a backoff to reduce the cache-coherence traffic, cause it is spinning locally on a variable inside the same core, but for the FIFO queue we need a backoff for its Ticket mechanism but this is not so difficult cause the locked region has a constant length, this is why i have added a backoff mechanism to the Ticket mechanism inside the push() method of lockfree_mpmc.pas, i have benchmarked it and it's giving a good performance, so this is why my scalable distributed fair lock is better than the Ticket spinlock and it's FIFO fair when there is contention, so it avoids starvation also. Thank you, Amine Moulay Ramdane,
Back to comp.programming.threads | Previous | Next | Find similar
About my scalable distributed fair Lock 1... aminer <aminer@toto.net> - 2013-10-05 17:46 -0700
csiph-web