Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming.threads > #1734
| From | aminer <aminer@toto.net> |
|---|---|
| Newsgroups | comp.programming.threads |
| Subject | Re: Ticket spinlock... |
| Date | 2013-09-23 17:07 -0700 |
| Organization | albasani.net |
| Message-ID | <l1qai8$7sg$1@news.albasani.net> (permalink) |
| References | <l1q9mr$6dg$1@news.albasani.net> |
I correct some english mistakes, pease read again... Hello, That's not the end of the story, i have benchmarked the ticket spinlock that i am using and that you find here: http://code.google.com/p/gpdelphiunits/source/browse/trunk/src/SpinLock.pas?r=37 and found that it has a poor performance cause in the case of a spinlock without tickets when it is unlocked() the first thread that comes first to the lock() will enter immediatly the locked section, but that's not the case with a Ticket spinlock cause if the first thread that enters the lock() first has not the ticket to enter, the other thread that have the ticket to enter and that is waiting for his turn will wait longer/more , so this is why the Ticket spinlock has a poor performance compared to a simple spinlock with a backoff. So i will advise you to avoid the Ticket spinlock. Thank you, Amine Moulay Ramdane. On 9/23/2013 4:52 PM, aminer wrote: > > Hello, > > That's not the end of the story, i have benchmarked the ticket spinlock > that i am using and that you find here: > > http://code.google.com/p/gpdelphiunits/source/browse/trunk/src/SpinLock.pas?r=37 > > > and found that it has a poor performance cause in the case of a spinlock > without tickets when it is unlocked() the first thread that comes first > to the lock() will enter immediatly the locked section, but that's not > the case with a Ticket spinlock cause if the first thread that enter the > lock() have not the ticket the other threads that have the ticket and > that are waiting for there turn will wait more , so this is why the > Ticket spinlock have a poor performance compared to a simple spinlock > with a backoff. > > > So i will advice you to avoid the Ticket spinlock. > > > > > Thank you, > Amine Moulay Ramdane.
Back to comp.programming.threads | Previous | Next — Previous in thread | Find similar
Ticket spinlock... aminer <aminer@toto.net> - 2013-09-23 16:52 -0700 Re: Ticket spinlock... aminer <aminer@toto.net> - 2013-09-23 17:07 -0700
csiph-web