Netflix / Hystrix

Hystrix is a latency and fault tolerance library designed to isolate points of access to remote systems, services and 3rd party libraries, stop cascading failure and enable resilience in complex distributed systems where failure is inevitable.
24.08k stars 4.7k forks source link

when will we change Striped64 from hystrix-core with the Striped64 in Java8 #1922

Open HaoChou opened 5 years ago

HaoChou commented 5 years ago

as we know that Java8 have provide an annotation [ @sun.misc.Contended ]. Striped64 is also been provide in Java8.

the old Striped64 class reduce cache contention using padding, like this:

 static final class Cell {
    volatile long p0, p1, p2, p3, p4, p5, p6;
    volatile long value;
    volatile long q0, q1, q2, q3, q4, q5, q6;

it works depending on JVM would not change some rules.

the new Striped64:

@sun.misc.Contended static final class Cell { volatile long value;

it should be more stable。

but it would need java8 or later.