[RFC][netx]: unsafe write to HashMap
Denis Lila
dlila at redhat.com
Tue Apr 5 09:21:48 PDT 2011
> If you need the Map to be safe for concurrent access, then you should
> say so in its type, no?
That's a good point. Is it ok to push after I
change "Map" to "ConcurrentHashMap"? (I would like to avoid
another patch for such a small change)
Thank you,
Denis.
----- Original Message -----
> On 04/05/2011 05:13 PM, Denis Lila wrote:
>
> > I think I found a concurrency problem in
> > ResourceTracker.addResource. This method is not static.
> > It is called from different threads, and it writes to
> > downloadOptions which is a static HashMap. This is not
> > safe. The patch uses a ConcurrentHashMap. That should
> > be enough to fix it.
>
>
> Andrew.
More information about the distro-pkg-dev
mailing list