<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi Bryan,<div><br></div><div>See how it works with thread pool especially if you use one of the lock free structures to create a pool. My bet is that a ConcurrentLinkedQueue would be a good candidate. I'll commit BufferedConcurrentHashMap probably in a week or so. Ideally we can then compare BufferedConcurrentHashMap with thread pool approach. </div><div><br></div><div>Regards,</div><div>Vladimir</div><div><br></div><div><br><div><div>On 2010-01-27, at 7:00 PM, Bryan Thompson wrote:</div><br><blockquote type="cite">
<div style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space">
<div dir="ltr" align="left"><span class="923295017-27012010"><font face="Courier New" color="#0000ff" size="4"></font></span> </div>
<div dir="ltr" align="left"><span class="923295017-27012010"><font face="Courier New" color="#0000ff" size="4">So, overall, this approach is working out very nicely for
us in combination with WeakReferences. </font></span><span class="923295017-27012010"><font face="Courier New" color="#0000ff" size="4">One
drawback of the approach is that hard references remain in the thread-local
arrays until they are batched through the lock. Depending on how threads
are managed, it is possible for hard references to remain in the thread local
queues long past their last touch. For this reason we do not use this
technique when the cache contains expensive resources where we need a better
guarantee of timely discard when they resource is no longer in use by the
application. It might be possible to address this concern with a protocol
to attach and detach the thread-local buffers from threads on their way into /
out of a thread pool.</font></span></div>
<div dir="ltr" align="left"><span class="923295017-27012010"><font face="Courier New" color="#0000ff" size="4"></font></span></div></div></blockquote><blockquote type="cite"><div style="WORD-WRAP: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space"><div dir="ltr" align="left"> </div></div></blockquote></div></div></body></html>