Re: Next questions

Etienne Gagnon <[email protected]> Sat, 15 Oct 2005 22:35:22 -0400
Newsgroups gmane.comp.java.vm.sablevm.devel
Message-ID <[email protected]>
Hi Martin,

> 1) What's exactly a 'native_global' in sablevm?

That's actually explaine in the JNI specification (and user guide):
http://java.sun.com/docs/books/jni/index.html

> 2) I try to implement the JDWP command 1/5 (VirtualMachine Command Set /
> TopLevelThreadGroups).
> Because InelliJ IDEA ask for it. I'll implement it in the same style as
> CMD_THREAD_GROUP_REFERENCE.
> Sending only two group id's 1 for system and 2 for user. So I didn't
> need GetTopThreadGroups in JVMDI.
> Is that ok like that?

I think you should as this question to Nizar.  I am not sure if he is
reading this list, though.  [You have his email, yes?]

> 3) I need an explanation about this in jni.h:
> /* opaque types */
> typedef struct _jobject *jobject;
> 
> Is it right, that 'jobject' will be replaced with 'struct _jobject *'?
> So _jobject needs to be somewhere declared, right? If yes, where is the
> declaration?


Actually, there are 2 distinct definitions of jobject.  If you are
within SableVM (e.g. within the JVMDI implementation), then the
definition of src/libsablevm/jnidefs.h applies.

If, instead, you are outside SableVM (e.g. within libjdwp), then the
opaque definition applies.

> 4) If in ./src/libjdwp/transport.c in method 'dt_socket_client(...)' a
> call to
> 'vm_proper_exit (jdwp, EXIT_FAILURE);' occur, sablevm will cause a
> deadlock and I have to kill sablevm. vm_proper_exit calls DestroyJavaVM
> (in ./src/libsablvm/invoke_interface.c) and there is the following code:
> 
> /* wait for all non-deamon threads to die */
> while (vm->threads.user != NULL)
>    {
>      _svmm_cond_wait (vm->threads.vm_destruction_cond, vm->global_mutex);
>    }
> 
> which waits on other threads end. But what's if the other threads are in
> the following state
> SVM_THREAD_STATUS_HALTED? On my last debug session it was the
> StartAppHelper thread.

Good question.  I have no quick answer.  In the "normal" (i.e.
non-debugging) mode of  execution, the vm is not responsible of user
program deadlocks.  In debugging mode, maybe SableVM should simply call
"exit(some_code)"?  This all depends on the specification of
"vm_proper_exit" of course.

Etienne

-- 
Etienne M. Gagnon, Ph.D.            http://www.info2.uqam.ca/~egagnon/
SableVM:                                       http://www.sablevm.org/
SableCC:                                       http://www.sablecc.org/

_______________________________________________
SableVM-devel mailing list
[email protected]
http://sablevm.org/lists/control/listinfo/sablevm-devel
signature.asc (application/pgp-signature, 256 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDUbxqjyrJi4rH84gRAo+iAKCBjAns3cmeulDoi3u5RQp7Ru8p4ACdHldP
nzLnwy7v8LiqPnNb2rYX2VE=
=ii7J
-----END PGP SIGNATURE-----