Hi:

I got a few questions on JNI on Linux.  It would be appreciated if someone
could help.

Suppose a shared library file has a function that is used to do hardware
I/O, say hard drives R/W.  A Java application uses JNI and calls this native
function in .so file twice to R/W two separate hard drives at the same time.
In this way, we should have two new threads (light weight processes) t1 and
t2 created (am I right?).

Q1: Since Java application and two newly-created threads (t1 and t2) share
the same memory space, if t1 messes up memory space and hangs, then Java
application and t2 will hang too, right?

Q2: If the answer to Q1 is "right", is it possible to protect Java
application and t2 and prevent them from hanging after t1 is hung if we use
JNI?

Q3: If the answer to Q2 is "no", then do you think out-proc solutions (i.e.
leave native functions in different memory spaces) like CORBA, TCP/IP and
DCOM (not sure it's available now or not on Linux) are better than in-proc
solution like JNI, so we can separate native functions in different memory
spaces and prevent one from messing others?  Is there any potential problem?


Thank you in advance.



Lee


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

Reply via email to