JNI calls that don't return

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ian Rogers wrote:
> The JNI provides mappings to monitor entry and exit. From google I found 
> this document:
> 
> http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jniref.html#thrd 
> 

That is some tutorial.  Not a specification on how JNI, JVMs or 
threading systems work.


> 
> I quote:
> 
> You may find that in cases where you want access to a local system 
> resource like a MFC window handle or message queue, it is better to use 
> one Java |Thread| and access the local threaded native event queue or 
> messaging system from within the native code.
> 
> So, it would seem to me that this is recommending using a single Java 
> thread to access a local system resource which would avoid M-to-N 
> threading issues as M would be 1. In classpath we are currently using 
> multiple Java threads to access gtk. Whilst the quote is short of saying 
> what to do with threading and JNI, I think it is a strong hint to 
> programmers that this is a fairly murky area, probably because of the 
> mixing of threading models.
> 

It is only a recommendation from a tutorial writer.  The JVM and runtime 
libraries can do whatever they want within the constraints of the 
specifications.
.
.
.
> 
> I hope this clears up my point-of-view. Thanks,
> 


[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux