harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiao-Feng Li" <xiaofeng...@gmail.com>
Subject Re: [drlvm][threading] synchronizing native and java access of the thread state (Harmony-3289)
Date Mon, 05 Mar 2007 03:10:44 GMT
If the thread states query and modification methods are mostly native,
I think a native lock is more feasible. Then we don't need a special
trick to stuff a java object with a "native" field.

Btw, native methods, including JVMTI, can use native monitor APIs to
access the Java object lock. But I would prefer native locking for
threading operations.


On 3/5/07, Weldon Washburn <weldonwjw@gmail.com> wrote:
> I decided to put a response to H3289 on the dev list since it is a general
> threading issue.  Please look at 3289 for background info.
> In response to the question about JVMTI functions being able to grab a lock
> in java.lang.Thread class, maybe a workable approach would be to replace
> locking the java object with a mutex created in native code and stuffed into
> a private int field of java.lang.Thread.  The Java code would use  native
> method APIs to grab and release this new native mutex.   And the native code
> (including JVMTI) would use the standard hymutex_lock(), hymutex_unlock().
> The native code would manage the life-cycle of the private int field
> containing a pointer to the native mutex.
> --
> Weldon Washburn
> Intel Enterprise Solutions Software Division

View raw message