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


I didn't get a chance to look at this carefully.  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?
I'm not sure whether performance matters a lot here, but if I'm right,
the change would still make sense to set a good example.

My operating assumption is that you generally want to avoid Vector
if at all possible.

Hans

> -----Original Message-----
> From: java-patches-owner@gcc.gnu.org 
> [mailto:java-patches-owner@gcc.gnu.org] On Behalf Of Keith Seitz
> Sent: Monday, June 06, 2005 1:16 PM
> To: GCJ Patches
> Cc: classpath patches
> Subject: [RFA/JDWP] JdwpConnection
> 
> 
> Hi,
> 
> This is the final class for jdwp.transport. This is where it 
> all comes together.
> 
> I would appreciate more eyes on the threading issues. I think 
> I have it right, but I could be wrong. (I don't believe I'll 
> ever feel confident about threading issues. Too darn sneaky!)
> 
> A note about threads in this class: this class is a thread 
> which reads bytes off the transport, packages them into 
> JdwpPackets, and adds the to a packet queue for the packet 
> processor thread(s) to grab. So other threads will be 
> accessing several (but not all) methods in this class (like 
> getPacket, sendPacket, shutdown).
> 
> I was originally planning to overlook shutdown because the 
> JDWP spec is not particularly clear about shutdown. It seems 
> that once a debugger is attached, the only way for the 
> debugger to disconnect is via VirtualMachine.Exit (in 
> "normal" situations). The spec for this command says that the 
> VM be "abruptly" shut down. I believe this means via 
> System.exit -- the whole thing (VM & back-end) dies.
> 
> FWIW, I've spent a little time on clean shutdown for the case 
> where the debugger just closes its connection. This could 
> then allow the JDWP back-end to disconnect and allow the VM 
> to continue executing bytecode. [Of course, we could then 
> also allow the possibility of re-attaching the debugger, but 
> I am not exploring that route right now.]
> 
> Keith
> 
> ChangeLog
> 2005-06-06  Keith Seitz  <keiths@redhat.com>
> 
>         * gnu/classpath/jdwp/transport/JdwpConnection.java: New file.
> 
> 


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