kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neha Narkhede <neha.narkh...@gmail.com>
Subject Re: SegmentList remove CAS in 0.8
Date Mon, 02 Dec 2013 14:21:27 GMT
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 <
Heaton.Chen@hughestelematics.com> 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
>
> *Heaton.Chen@hughestelematics.com <Wenjian.Bai@hughestelematics.com>*
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message