classpath
[Top][All Lists]
Advanced

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

Re: SWING at OJE


From: Etienne M. Gagnon
Subject: Re: SWING at OJE
Date: Mon, 05 Feb 2001 12:49:20 -0500

Jeff Sturm wrote:
> CNI is not VM independent.  It was designed for gcj.  It's fast because there 
> is
> really no overhead: C++ classes can directly access Java methods and fields, 
> for
> instance.

OK. So my understanding of CNI seems correct.  Now, why are you
criticising Sun on JNI's design?  I see nothing wrong with it, as it has
a clean separation from the internals of a VM, including its garbage
collector.  

You shouldn't be comparing apples with oranges.  CNI has different
goals, and assumptions.  CNI is not well suited for moving collectors,
which are key to some efficient advanced garbage collection algorithms. 
(HotSpot collects the yongest generation with a copying collector).

Using the JNI efficiently is also an art.  If you never cache your
method/fied IDs, your code will be slower.  Other things are imposed by
a clean native interface:  the VM should be able to garbage collect
without waiting for a native thread to return (or call back into the
VM).  I'm not sure CNI handles this well... (I'm pretty sure it doesn't,
unless it assumes a conservative GC algorithm).

Etienne
-- 
----------------------------------------------------------------------
Etienne M. Gagnon, M.Sc.                     e-mail: address@hidden
Author of SableCC:                             http://www.sablecc.org/
and SableVM:                                   http://www.sablevm.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]