[concurrency-interest] Contention on ReferenceQueue#poll()...

James Gan ganzhi at gmail.com
Wed Mar 3 03:58:16 EST 2010

I've sent a patch to Harmony for solving this contention problem
several weeks ago. The new ReferenceQueue uses lock-free algorithm

Here is the patch that I submitted:

On Tue, Feb 2, 2010 at 12:17 AM, Bryan Thompson <bryan at systap.com> wrote:
> Hello,
> I am observing contention in ReferenceQueue#poll() for the internal lock used by that class.  Our use case is to clear entries from a weak value cache once their References have been cleared.  We are working to minimize contention from the application by controlling which thread calls ReferenceQueue#poll(), but it seems that it would be useful to have a ReferenceQueue#drain(...) method which hands back an array of references which have been cleared, perhaps by writing them into an array provided by the caller.  Regardless of the specific method signature, this would make it faster for a thread to consume the elements from the ReferenceQueue.
> Thanks,
> Bryan
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest

Best Regards
James Gan
Current Project: Concurrent Building Block at http://amino-cbbs.sourceforge.net/
Blog: http://ganzhi.blogspot.com

More information about the Concurrency-interest mailing list