[concurrency-interest] AtomicInteger.getAndIncrement()

bank kus kus.bank at gmail.com
Sat Dec 12 15:21:36 EST 2009


Is this guaranteed to complete in a finite number of steps. Asking
because am evaluating if I can implement ticket locking using this.

On a 16 virtual core system if all 16 vcores simultaneously had
threads invoke this operation ..
<a> are all vcores guaranteed to block context switching to any other
threads on their runqueues until this operation completes

<b> is there fair arbitration between cores. The pathological case
being vcore 2 gets to increment  then gets to do it again while other
vcores wait trying to do so.

I understand this would depend upon the hw instructions used but am
curious if any fair expectation can be made out of this API.

Regards
banks


More information about the Concurrency-interest mailing list