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

Bryan Thompson bryan at systap.com
Wed Mar 3 07:40:06 EST 2010


James, do you know if a similar patch is making its way into the Sun JVM?  I am wondering if we should implement a workaround now or just want for a new JVM accepting some contention today.  Thanks, Bryan
________________________________________
From: James Gan [ganzhi at gmail.com]
Sent: Wednesday, March 03, 2010 3:58 AM
To: Bryan Thompson
Cc: concurrency-interest x
Subject: Re: [concurrency-interest] Contention on ReferenceQueue#poll()...

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

Here is the patch that I submitted:
https://issues.apache.org/jira/browse/HARMONY-6344

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