"Etienne M. Gagnon" wrote:
> 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.

It wasn't so much a criticism as an observation.  I know there are very
different design goals.  It is exactly these goals that may make JNI a poor fit
for some applications (e.g. window systems) however.

> 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.

CNI supports any garbage collection that g++ does.  You might say g++ is not
well suited for moving collectors.  A copying collector for g++ should be
possible (though difficult) with type information supplied by the compiler
(dwarf-2 maybe?), provided one does not play tricks like hiding pointers in a
`long'.

That said, I have experimented with many GC algorithms and remain skeptical of
the merits of copying collectors.  Conservative GC can be made to work very well
in a broad range of applications, hard real-time being a possible exception (but
we were talking about Swing, so real-time is getting way of topic I suppose).

> Using the JNI efficiently is also an art.

Hand-coded assembly is also an art.  But there aren't many who want to do it.

--
Jeff Sturm
[EMAIL PROTECTED]

_______________________________________________
Classpath mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/classpath

Reply via email to