The lock statement at the Log.scala level is required to make truncation/deletion thread safe. My understanding of AtomicReference vs volatile is that the former is useful if you want to use compound actions like getAndSet/compareAndSet. Since we don't use those, using volatile might suffice.
Thanks, Neha On Thu, Nov 28, 2013 at 1:27 AM, Heaton Chen < [email protected]> wrote: > I saw the source code SegmentList.scala in 0.8 remove the CAS statement > and add lock statement in Log.scala. Does it necessary to use > AtomicReference List or can just use @volatile in place? > > > > Regards > > Heaton Chen > > Web Administrator > > > > [image: 1314_HTIChinaLimitedLogo_2_13_color] > > HTI (China) Limited > > 15/F, Building D, NOVA Center, No.5 Dongfeng Third road, Wuhan Economic & > Technological Development Zone, Hubei, China > > Zip: 430056 > > Cell: 86 13437167669 > > *[email protected] <[email protected]>* > > >
