On Tue, Jan 18, 2000 at 11:28:17AM -0600, [EMAIL PROTECTED] wrote:
> 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?).
Calling into native code doesn't create new threads - it just moves the
flow of control from the Java interpreter into some other native code.
After the JNI method returns, you're back to executing native code in the
Java interpreter.
Nathan
>
> 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
--
[EMAIL PROTECTED] Public Access User -- Not affiliated with Teleport
Public Access UNIX and Internet at (503) 220-1016 (2400-28800, N81)
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]