tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: svn commit: r1703151 - /tomcat/trunk/java/org/apache/catalina/tribes/transport/nio/NioReceiver.java
Date Tue, 15 Sep 2015 20:26:34 GMT
On 15/09/2015 21:18, Felix Schumacher wrote:
> 
> 
> Am 15. September 2015 21:47:57 MESZ, schrieb Mark Thomas <markt@apache.org>:
>> On 15/09/2015 18:41, Felix Schumacher wrote:
>>> Hi Mark,
>>>
>>> why didn't you remove the synchronization when you converted the code
>> to
>>> ConcurrentLinkedDeque?
>>
>> No idea. Focusing on one thing and missing the obvious I suspect.
>>
>>> The old code had a concurrency problem, since events.size() was
>> checked
>>> outside of the synchronize block. I think this is not a problem
>> anymore,
>>> but I don't understand the call to events.clear() afterwards the
>>> while-loop in events(). We think we have guarded the queue and
>> removed
>>> all entries by calling pollFirst repeatedly, so why clear it
>> afterwards?
>>
>> Don't know. I'll take another look and clean it up some more.
> 
> While you are looking at the code. The api docs say that queue.size() is quite expensive.
My guess is, that queue.isEmpty() is quite cheap.

All fixed. (I think.)

Thanks for the review.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message