>>>>> "Matt" == Matt Welsh <[EMAIL PROTECTED]> writes:

    Matt> Turns out this is not as easy as it could be -- because even
    Matt> though you call system calls like read(), write(), and
    Matt> fcntl() from native code, these are trapped by the Java
    Matt> runtime library to do magic things when green threads are
    Matt> used!

Why don't you use native threads?  The IO-wrappers are one of the main
reasons why JNI and green threads don't mix well and we don't support
JNI on green threads..

    Matt> The solution? Go behind JNI's back, and get the "real"
    Matt> system call handles by using dlopen/dlsym on /lib/libc.so.6
    Matt> (or wherever your standard C library happens to be
    Matt> installed), and call them directly.

That's ugly.

    Matt> The good news is that it seems to work. Note that when
    Matt> native threads are used, the JDK does not attempt any funny
    Matt> business, and there are no problems.

So don't use green threads.


        Juergen

-- 
Juergen Kreileder, Blackdown Java-Linux Team
http://www.blackdown.org/java-linux.html
JVM'01: http://www.usenix.org/events/jvm01/


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to