incubator-blur-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron McCurry <amccu...@gmail.com>
Subject Re: SlabAllocationCacheValueBufferPool thread-safe?
Date Wed, 20 Jul 2016 18:08:33 GMT
I don't think there is a race condition because the allocation occurs
atomically in the BlockLocks class.  Do see a problem?  Let me know.

Aaron

On Wed, Jul 20, 2016 at 9:19 AM, Ravikumar Govindarajan <
ravikumar.govindarajan@gmail.com> wrote:

> I came across the following in SlabAllocationCacheValueBufferPool.java. Is
> the below method thread-safe?
>
>  @Override
>
>   public CacheValue getCacheValue(int cacheBlockSize) {
>
>     validCacheBlockSize(cacheBlockSize);
>
>     int numberOfChunks = getNumberOfChunks(cacheBlockSize);
>
>     ...
>
>    }
>
>
> It does allocation in a tight-loop using BlockLocks, Slab & Chunks. Is
> there a race-condition where 2 threads can pick same slab & chunk?
>

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