-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compatibility with Threads? #131
Comments
Did you set the environmental variable |
Oh, you're on Windows... hmm. Also we may need to do something with |
I'm going to drop some hints here. Essentially to get this to work, you'll have to tap the lower level JNI interface in JavaCall: using JavaCall
JavaCall.init()
# The following is a pointer to the AttachCurrentThread function of the JVM. Use ccall or @ccall to call that.
JavaCall.JNI.jvmfunc[].AttachCurrentThread The C definition of that is jint AttachCurrentThread(JavaVM *vm, void **p_env, void *thr_args); The call to that is going to look a lot like So something like:
When using JavaCall from a new thread: empty!(JavaCall._jmc_cache) # You might need to do @jimport anew
JavaCall.JNI.ppenv[] = ppenv_this_thread[] There are synchronization issues there. The real solution is to to figure out the new thread specific
|
I started an experimental branch to push multithreading forwards on Linux / MacOS: |
Trying to run jcall in a separate thread kills the julia session:
The text was updated successfully, but these errors were encountered: