In message <[EMAIL PROTECTED]>, Bernd Kreimeier writes:
In case you missed it on the list - Juergen Kreileder just told me
that JNI can't work with green_threads under Linux, if you use
certain system calls like open(). I just checked the FAQ as he
said it's "documented" - I had missed that so far.
Bernd,
Yes, I've been listening; I was just as surprised as you. So I just
read the links you and Juergen mentioned, and consulted one other
reference:
[1] http://developer.java.sun.com/developer/bugParade/bugs/4040743.html
[2] http://java.sun.com/docs/books/tutorial/native1.1/implementing/invo.html
[3] "Essential JNI" by Rob Gordon, published 1998 by Prentice Hall PTR.
I would like us to make a strong distinction at this point between
straight JNI and the JVM Invocation API. JNI apparently isn't what's
broken; the Invocation API is in some cases, namely yours and anyone
else's who decides to do fairly normal things like "read, readv,
write, writev, getmsg, putmsg, poll, open, close, pipe, fcntl, dup,
create, accept, recv, send, and so on." [2]
Rob Gordon suggests on [3] page 260 that:
When building a Java-enabled application on Solaris and linking
against the green threads version of libjava.so, you must defer system
calls until after the call to JNI_CreateJavaVM. This is because the
user-level threads package in libjava.so (green threads) defines its
own system calls . . .
Also, I'm wondering if you've had any luck with this advice:
The first step toward getting this to work is always to link
libjava.so into the executable *first*, even before libc.so . . . [1]
When some of this gets clearer, I'll update the FAQ. Thanks for your
help and suggestions!
Steve