Re: synchronized code - Mailing list pgsql-jdbc

From Michael Paesold
Subject Re: synchronized code
Date
Msg-id 01a201c2b747$3e7dfb80$3201a8c0@beeblebrox
Whole thread Raw
In response to synchronized code  (Felipe Schnack <felipes@ritterdosreis.br>)
List pgsql-jdbc
Felipe Schnack <felipes@ritterdosreis.br> wrote:

>   I'm quite worried with the amount of synch'd code in our jdbc driver
> code, we all know this is a very costly operation in Java.
>   As far as I could see from the sources, the sole objective of these
> calls are to avoid two processes accessing the same shared StringBuffer
> we use. The strangest thing, IMHO, is that every time we use this
> buffer, we are calling setLength(0) or, in plain english, resetting this
> buffer. Is just me the paranoid or this isn't helping performance at
> all? As I understand java, object creating is a very cheap operation
> these days (in the old days it was slow), but synch'ing is VERY
> costly...

Sun claims that with Java 1.4, synchronization isn't *that* expensive
anymore. Anyway, object creation has improved, too. Which JVM are most
people using? Probably more people still use 1.3, especially with J2EE. Just
my $0.02.

Regards,
Michael


pgsql-jdbc by date:

Previous
From: Felipe Schnack
Date:
Subject: synchronized code
Next
From: "Patric Bechtel"
Date:
Subject: Re: synchronized code [Viruschecked]