This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
RE: [RFA/JDWP] JdwpConnection
- From: "Boehm, Hans" <hans dot boehm at hp dot com>
- To: "Keith Seitz" <keiths at redhat dot com>
- Cc: "GCJ Patches" <java-patches at gcc dot gnu dot org>
- Date: Mon, 6 Jun 2005 14:42:19 -0700
- Subject: RE: [RFA/JDWP] JdwpConnection
It looked to me like you can't get rid of the synchronization you
do; you need larger actions than single Vector accesses to be atomic.
I think that's the usual case, and ArrayList is just more useful than
Vector.
Hans
> -----Original Message-----
> From: Keith Seitz [mailto:keiths@redhat.com]
> Sent: Monday, June 06, 2005 2:04 PM
> To: Boehm, Hans
> Cc: GCJ Patches
> Subject: RE: [RFA/JDWP] JdwpConnection
>
>
> On Mon, 2005-06-06 at 13:48 -0700, Boehm, Hans wrote:
> > But it seemed to
> > me that _commandQueue is a Vector, but you always synchronize on it
> > before accessing it? If so, wouldn't ArrayList, which doesn't lock
> > internally, make more sense?
>
> Yes, you are right: Vector is synchronized. For some reason,
> I didn't think it was (I missed that during my cursory glance
> of the javadoc). So either I change to some unsychronized
> form, or I just whack the synchronization bits.
>
> I don't think that performance is so critical here, though,
> so switching to an ArrayList might be a better choice.
>
> Thanks,
> Keith
>
>