harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Evgueni Brevnov" <evgueni.brev...@gmail.com>
Subject Re: [drlvm] HARMONY-1582 - invocation API for DRLVM
Date Wed, 27 Sep 2006 10:41:36 GMT
Here is the second part which provides details on thread_java_basic.c.

1) jthread_create_with_function
a) JavaVM * java_vm argument instead of JNI_Env * env. First of all
when jthread_create_with_function is called there is no jni
environment created for new thread yet. It will be created when
vm_jthread_attach is called. vm_jthread_attach wants to know to which
VM current thread should be attached. That's why I pass java VM
instead of JNI environment. As I sad once we can think of  modifying
current scheme and call vm_jthread_attach before
jthread_create/jthread_attach. In that case it is reasonable to pass
JNI_Env.
b) removed support for irregular use. I think it is not very good to
have that code for  couple of reasons. First (not very important) it
is useless actions in any real scenario. At least everything works
just fine without it. Second it can hide a real problem. According to
current design there should be no such cases when jthread object is
not associated with hythread. It can be important to catch if
something goes wrong as early as we could.
c) removed temporary pool creation. Actually this pool has the same
life time as global APR pool. So it is a memory leak. Moreover I just
don't see any reason to create it. Lets use existing one with proper
life time.
d) "daemon" notion was moved to hythread layer. That's really
discussable. See one of my previous mail.

2)jthread_attach
a) signature has changed significantly. Hmm, that was required to
implement InvocationAPI according to spec :-) Ask particular questions
please if you have them.

3)jthread_detach same story as 2)

4) wrapper_proc: Seems like a lot of changes but not so many
important. Only two changes are really significant:
a) moved processing of non-daemon threads to hythread layer. Discussed earlier.
b) added initialization of jvmti_thread->jenv field. Actually this is
the only place when it is first available...

Ups... it seems I missed jvmti_send_thread_start_end_event(1) in one
of my merges.... need to be fixed.


Thanks
Evgueni

On 9/27/06, Evgueni Brevnov <evgueni.brevnov@gmail.com> wrote:
> On 9/27/06, Gregory Shimansky <gshimansky@gmail.com> wrote:
> > On Tuesday 26 September 2006 17:25 Geir Magnusson Jr. wrote:
> > > Wanted to start a new thread with better subject line.
> >
> > I want to take part in this thread too.
> >
> > 1. As Tim has mentioned in a separate thread the multiVM support requires that
> > we don't use global and static variables in native code. One global variable
> > used often in drlvm across all of the code is Global_Env::loader_env. I
> > didn't find it in the patch code so I want to ask you, did you move this
> > pointer into TLS?
> Not exactly. You are right I tried to write the code which supports
> multi VM. But that was not my main goal at this moment. So what I did
> in that direction is
> 1) I added JNIEnv * into VM_thread structure. So you can always get a
> Global_Env having JNIEnv. Probably it makes sense to use VM local
> storage to keep Global_Env as well. I consider it as another
> task....not InvocationAPI
> 2) Localized thread library instance for each VM.
> 3) Fixed those places where Global_Env can be extracted from JNI_Env
> *. see jni_get_vm_env function.
>
> >
> > 2. Can we get avoid all of the CR-LF EOLs introduced in this patch?
> I will do my best in the future. I promise :-)
>
> Evgueni
> >
> > --
> > Gregory Shimansky, Intel Middleware Products Division
> >
> > ---------------------------------------------------------------------
> > Terms of use : http://incubator.apache.org/harmony/mailing.html
> > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> > For additional commands, e-mail: harmony-dev-help@incubator.apache.org
> >
> >
>

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message