RFR: 8253179: Replace LinkedList Impl in net.http.Http2Connection
Pavel Rappo
prappo at openjdk.java.net
Thu Oct 1 10:43:23 UTC 2020
On Thu, 1 Oct 2020 10:31:58 GMT, Conor Cleary <ccleary at openjdk.org> wrote:
>> Good point Aleksey. I guess that the original intent was to avoid `ConcurrentModificationException`. However I see that
>> `streams` is a `ConcurrentHashMap` now. So maybe we could dispense of the copy:
>> ` private final Map<Integer,Stream<?>> streams = new ConcurrentHashMap<>();`
>>
>> Could be worth changing the type from `Map<Integer,Stream<?>>` to `ConcurrentMap<Integer,Stream<?>>` in the declaration
>> above if we decide to get rid of the copy though.
>
> Taking a look at this presently
Although Aleksey's proposal does not change the behavior, it raises a question (to be explored separately): can a
stream be added to that map while `Http2Connection.shutdown` is in progress? If this is the case, then the method is
racy.
-------------
PR: https://git.openjdk.java.net/jdk/pull/431
More information about the net-dev
mailing list