[concurrency-interest] Re: Question about Hashtable and ConcurrentHashMap.

Jonathan Gibbons Jonathan.Gibbons@Sun.COM
Thu, 07 Oct 2004 10:31:10 -0700


--Boundary_(ID_2xWBi9QYZjIw6b9EWLrInA)
Content-type: text/plain; charset=us-ascii; format=flowed
Content-transfer-encoding: 7BIT

Note also that Hashtable extends Dictionary, whereas ConcurrentHashMap 
does not,
so one can not always replace Hashtable by ConcurrentHashMap.

-- Jon

Scott Seligman wrote:

>>In my opinion... they are not compatible *enough*
>>    
>>
>
>Yes.  In the javadoc for ConcurrentHashMap, note the "but":
>
>    This class is fully interoperable with Hashtable in programs that rely
>    on its thread safety but not on its synchronization details.
>
>
>Scott
>  
>

-- 
Jonathan Gibbons	
mailto:jonathan.gibbons@sun.com   Phone: +1 (408)276-7432 (Internal: x17432)  
Sun Microsystems, Inc. USCA22-323 4220 Network Circle, Santa Clara, CA 95054



--Boundary_(ID_2xWBi9QYZjIw6b9EWLrInA)
Content-type: text/html; charset=us-ascii
Content-transfer-encoding: 7BIT

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title></title>
</head>
<body>
Note also that Hashtable extends Dictionary, whereas ConcurrentHashMap does
not,<br>
so one can not always replace Hashtable by ConcurrentHashMap.<br>
<br>
-- Jon<br>
<br>
Scott Seligman wrote:<br>
<blockquote type="cite"
 cite="mid200410070521.i975LNrS017643@spin.SFBay.Sun.COM">
  <blockquote type="cite">
    <pre wrap="">In my opinion... they are not compatible *enough*
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Yes.  In the javadoc for ConcurrentHashMap, note the "but":

    This class is fully interoperable with Hashtable in programs that rely
    on its thread safety but not on its synchronization details.


Scott
  </pre>
</blockquote>
<br>
<pre class="moz-signature" cols="$mailwrapcol">-- 
Jonathan Gibbons	
<a class="moz-txt-link-freetext" href="mailto:jonathan.gibbons@sun.com">mailto:jonathan.gibbons@sun.com</a>   Phone: +1 (408)276-7432 (Internal: x17432)  
Sun Microsystems, Inc. USCA22-323 4220 Network Circle, Santa Clara, CA 95054
</pre>
<br>
</body>
</html>

--Boundary_(ID_2xWBi9QYZjIw6b9EWLrInA)--