Closed bernardoaraujor closed 6 years ago
Hi,
Please see JNI docs.
JNI_CreateJavaVM
: "Creation of multiple VMs in a single process is not supported."
JNIGI cannot do things that JNI can't do.
If you are trying to run your method concurrently, maybe you want to use AttachCurrentThread
.
Have a look at https://github.com/timob/jnigi/blob/master/jnigi_test.go#L135 TestAttach
on how to use AttachCurrentThread
. In your code processPass
call AttachCurrentThread
create the object and call the method.
Cool! I'll dig into it! Seems kinda obvious, now that you pointed it!
Thanks so much Tim!
Regards, Bernardo.
On Nov 12, 2017 19:28, "timob" notifications@github.com wrote:
Have a look at https://github.com/timob/jnigi/blob/master/jnigi_test.go#L135 TestAttach on how to use AttachCurrentThread. In your code processPass call AttachCurrentThread create the object and call the method.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/timob/jnigi/issues/13#issuecomment-343769391, or mute the thread https://github.com/notifications/unsubscribe-auth/AJP7tKd2oHyIokmoTU4u9O4G96Ubqoemks5s12MKgaJpZM4QanuQ .
works like a charm! thanks @timob
I'm trying to have many JVMs running on concurrent functions (in main()):
where processPass instantiates its own JVM (with a .jar classpath):
am I doing something wrong? or jnigi just can't have multiple JVMs running concurrently?