Hi,
I got a question on JNI. It would be appreciated if someone could help.
Q:
In order to hide java and jni related issues (e.g. jni function name
convention, etc.) from .so programmers, a wrapper .so file so1.so is used in
between java app and another .so file so2.so (the one with native functions
we need). This way, the java app interacts with the wrapper so1.so
directly. Every time when java app needs a native function service in
so2.so, it first calls a native function in so1.so through jni. so1.so, in
turn, calls the required function in so2.so. Everything works fine in this
direction (i.e. java app->so1.so->so2.so. java app loads so1.so, and so1.so
loads so2.so, then java app invokes a function in so2.so through a function
in so1.so). The question is how a function in so2.so calls back to java app
through a function in so1.so? In fact, we only need to know how functions
in so2.so can call functions in so1.so because jni will let us call back to
java app from so1.so.
More information:
- the java app is multithreaded application using Thread.start().
- each java thread may call the same function in so1.so, then
this function, in turn, calls a function in so2.so
- native code doesn't create any thread.
Use IPC? which one is easier on Linux? Is there any other mechanism
for this on Linux?
A simple sample code will help a lot.
Thank you.
Lee
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]