Am 15. September 2015 21:47:57 MESZ, schrieb Mark Thomas <[email protected]>:
>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. 

Best regards, 
Felix
>
>Mark
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [email protected]
>For additional commands, e-mail: [email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to