This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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
> 
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]