ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/ConcurrentHashMap.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/ConcurrentHashMap.java (file contents):
Revision 1.24 by dl, Fri Oct 10 23:51:28 2003 UTC vs.
Revision 1.25 by dl, Sun Oct 12 12:21:23 2003 UTC

# Line 17 | Line 17 | import java.io.ObjectOutputStream;
17   * adjustable expected concurrency for updates. This class obeys the
18   * same functional specification as {@link java.util.Hashtable}, and
19   * includes versions of methods corresponding to each method of
20 < * <tt>Hashtable</tt> . However, even though all operations are
20 > * <tt>Hashtable</tt>. However, even though all operations are
21   * thread-safe, retrieval operations do <em>not</em> entail locking,
22   * and there is <em>not</em> any support for locking the entire table
23   * in a way that prevents all access.  This class is fully
24   * interoperable with <tt>Hashtable</tt> in programs that rely on its
25   * thread safety but not on its synchronization details.
26   *
27 < * <p> Retrieval operations (including <tt>get</tt>) ordinarily
28 < * overlap with update operations (including <tt>put</tt> and
29 < * <tt>remove</tt>). Retrievals reflect the results of the most
30 < * recently <em>completed</em> update operations holding upon their
31 < * onset.  For aggregate operations such as <tt>putAll</tt> and
32 < * <tt>clear</tt>, concurrent retrievals may reflect insertion or
27 > * <p> Retrieval operations (including <tt>get</tt>) generally do not
28 > * block, so may overlap with update operations (including
29 > * <tt>put</tt> and <tt>remove</tt>). Retrievals reflect the results
30 > * of the most recently <em>completed</em> update operations holding
31 > * upon their onset.  For aggregate operations such as <tt>putAll</tt>
32 > * and <tt>clear</tt>, concurrent retrievals may reflect insertion or
33   * removal of only some entries.  Similarly, Iterators and
34   * Enumerations return elements reflecting the state of the hash table
35   * at some point at or since the creation of the iterator/enumeration.
36 < * They do <em>not</em> throw <tt>ConcurrentModificationException</tt>.
37 < * However, Iterators are designed to be used by only one thread at a
38 < * time.
36 > * They do <em>not</em> throw
37 > * <tt>ConcurrentModificationException</tt>.  However, Iterators are
38 > * designed to be used by only one thread at a time.
39   *
40   * <p> The allowed concurrency among update operations is guided by
41   * the optional <tt>concurrencyLevel</tt> constructor argument
# Line 44 | Line 44 | import java.io.ObjectOutputStream;
44   * number of concurrent updates without contention. Because placement
45   * in hash tables is essentially random, the actual concurrency will
46   * vary.  Ideally, you should choose a value to accommodate as many
47 < * threads as will ever concurrently access the table. Using a
47 > * threads as will ever concurrently modify the table. Using a
48   * significantly higher value than you need can waste space and time,
49   * and a significantly lower value can lead to thread contention. But
50   * overestimates and underestimates within an order of magnitude do
51 < * not usually have much noticeable impact.
51 > * not usually have much noticeable impact. A value of one is
52 > * appropriate when it is known that only one thread will modify
53 > * and all others will only read.
54   *
55   * <p>This class implements all of the <em>optional</em> methods
56   * of the {@link Map} and {@link Iterator} interfaces.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines