classpath
[Top][All Lists]
Advanced

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

Re: java.util.Hashtable.size()/isEmpty()


From: Dalibor Topic
Subject: Re: java.util.Hashtable.size()/isEmpty()
Date: Fri, 15 Feb 2002 02:37:37 -0800 (PST)

--- Sascha Brawer <address@hidden> wrote:
> Hello,
> 
> the implementations of java.util.Hashtable.size()
> and
> java.util.Hashtable.isEmpty() merely access a single
> integer member
> field.  Since accesses to integer variables are
> required to be atomic, I
> think these two methods don't need to be
> synchronized. Do people agree?

They have never [1] been marked as synchronized in
official Java APIs anyway. Some methods have changed
their synchronization status between relases, so you
might want to look into that as well.

Have fun,

Dalibor Topic

[1] Java 1.0 - Java 1.4

=====
"Success means never having to wear a suit"

__________________________________________________
Do You Yahoo!?
Got something to say? Say it better with Yahoo! Video Mail 
http://mail.yahoo.com



reply via email to

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