bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug classpath/27598] New: WeakHashMap can fail with concurrent readers


From: Hans dot Boehm at hp dot com
Subject: [Bug classpath/27598] New: WeakHashMap can fail with concurrent readers
Date: 14 May 2006 05:15:11 -0000

Java Collections are generally expected to be safe in the presence of
concurrent reads.

However many operations that read WeakHashMaps process the reference queue as
part of the operation, and may thus delete elements from the WeakHashMap.  As a
result, if two threads concurrently call e.g. size(), two threads may end up
concurrently deleting elements from the WeakHashMap, resulting in a damaged
data structure.

(This was based on code inspection, that failure has not been observed.  But an
actual failure would be irreproducible, and hence probably not result in a bug
report.)

An off-line discussion concluded that the right way to fix this is probably to
include enough internal locking to ensure that two concurrent readers cannot
interfere.

A corresponding bug report (6425537) was filed against the Sun JVM, based on
the same discussion.


-- 
           Summary: WeakHashMap can fail with concurrent readers
           Product: classpath
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: classpath
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Hans dot Boehm at hp dot com
 GCC build triplet: any
  GCC host triplet: any
GCC target triplet: any


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27598





reply via email to

[Prev in Thread] Current Thread [Next in Thread]