Показаны сообщения с ярлыком CAS. Показать все сообщения
Показаны сообщения с ярлыком CAS. Показать все сообщения

пятница, 29 июня 2012 г.

Use cases for weakCAS

В java.util.concurrent.atomic.AtomicXXX есть волшебный метод weakCompareAndSet, который отличается от оригинального  compareAndSet двумя моментами:
---
Для такого поведения (второй пункт) найдено пока два Use Case:
A) счетчики
B) Michael-Scott queues (надо попробовать реализовать)

P.S. Как понимаю, j.u.c.ConcurrentLinkedQueue реализовано на основе Michael-Scott queue, но использует "strong" CAS.

вторник, 8 июня 2010 г.

Cliff Click vs Doug Lea: about fence-less CAS

Interesting conversation(s) with Doug Lea

Abstract
We are discussing the merits of a no-fence CAS instruction - and exposing this instruction at the Java level. Since Intel does not have a no-fence this whole idea is a no-op for Intel. Right now there is a weak spurious-fail-allowed CAS in the Unsafe to mimic load-linked/store-conditional ops, to get buy-in from IBM whose chips do LL/SC instead of CAS. Doug wants to the fence-less CAS to allow spurious failure, and I do not because it causes me to add retry loops in places.

вторник, 10 ноября 2009 г.

Dr. Cliff Click: Towards a Scalable Non-Blocking Coding Style

Rapporteur at JavaOne 2008 from Dr. Cliff Click from Azul Systems one of the Best in the world specialist in Super-Scalable(768 and Up cores) Non-Blocking structures for Java.
Author of high-scale-lib (free lib at SourceForge) (lib has BitVector, HashTable and (FIFO-Queue in progress now)).

Dr. Cliff Click talk how by using FSM(Finite State Machine) and atomic-CAS create scalable non-locking structures.

"Classic reader/writer lock chokes w/ >100 CPUs
• Contention on single reader-count word limits scaling"

"• Lock-Free: Each CAS makes progress
• CAS success is local progress
• CAS failure means another CAS succeeded(global progress, local starvation)"

"JDK API mistake: witness turned into a boolean
• Hence failure-for-cause can not be distinguished from spurious-failure"

"Highly scalable (proven scalable to ~1000 CPUs)"

P.S. FSM model for verification maybe interesting for you, Igor?