logo       


Re: [FB-Discuss] Improper use of synchronized classes: msg#00039

Subject: Re: [FB-Discuss] Improper use of synchronized classes
Hi Pete,

On Tue, Jul 20, 2004 at 11:21:44AM -0700, Pete Angstadt wrote:
> Has anyone considered creating a detector for improper
> use of synchronized classes?
> 
> It's usually a performance problem when using
> Hashtable instead of HashMap, or Vector instead of
> ArrayList or an array.
> 
> For example, an obvious problem is when a Hashtable or
> Vector is instantiated and used only locally within a
> method (and isn't passed as a parameter to another
> method).  There are other possible problematic usages
> as well.
> 
> Any thoughts on this?

It wouldn't be too hard to flag Hashtables and Vectors that
were created in a method, and not assigned to a field,
passed to another method, or returned from the creating method.
Those objects would not be visible to multiple threads,
and thus the synchronization would be unnecessary.

However, are you sure that those classes represent a significant
performance overhead?  A lot of research (e.g., thin locks)
has been done to reduce the overhead of uncontended locks.
I would want to see performance results to know exactly what
the overhead is.

-Dave


Ruby Jobs
Java Jobs
Jobs in California
more...
what
job title, keywords
where
city, state, zip
jobs by job search
Search:
Java, servers, webhosts, VoIP...
more...
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
encryption.gpg....    ietf.rfc822/199...    freebsd.devel.i...    lang.haskell.li...    mail.squirrelma...    web.zope.plone....    yellowdog.gener...    text.xml.xalan....    recreation.phot...    kde.devel.educa...    hardware.bus.ca...    printing.ghosts...    voip.peering/20...    assembly/2006-0...    org.user-groups...    culture.interne...    network.i2p/200...    boot-loaders.ya...    xfree86.render/...    qnx.openqnx.dev...    jakarta.velocit...    user-groups.pal...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo