Hi all !

I am implementing jvmti for the cacao vm. Different processes have to be used in my implementaion because of ptrace used. The jdwp releated threads are started in a separate process (in a separte cacao vm) that is executed before any other java (client/debuggee) code has been executed. I need the jdwp threads/code to remain separted from the code that is supposed to call the client code (cacao jvmti is going to call the client code).

Martin


Keith Seitz wrote:

Hi,

I have a simple, if naive, question about synchronizing JDWP startup. When a VM starts JDWP, two new threads are created to handle communications to the debugger. The VM must wait for these threads to be completely initialized and running before continuing (which would almost certainly include sending a VM_INIT event).

The question is: how do people think is the best way to do this?

Right now, I've got JdwpConnection and PacketProcessor essentially setting an "I'm ready" flag in gnu.classpath.jdwp.Jdwp. Libgcj then spins on a method call to Jdwp.isInitialized, sleeping for some short time if the return value is false.

This works for gcj, but I'm uncertain of what other VMs would prefer.

Does anyone have an opinion one way or the other about how this is done right now? [Aka, should we worry about it when it becomes a problem?]

Keith



Reply via email to