-
Notifications
You must be signed in to change notification settings - Fork 747
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
OverlappingFileLockException while multithreading usage JavaCPP #650
Comments
You're not running the latest version. Please try again with the snapshots
and let me know if it still happens with 1.4.4-SNAPSHOT:
http://bytedeco.org/builds/
|
…appingFileLockException` with multiple class loaders (issue bytedeco/javacpp-presets#650)
Actually, I think I found what the issue is, commit bytedeco/javacpp@7ed4191 should work around this. Thanks for reporting! |
Sounds fine! So, this correction will be included in the next stable release on January? And now it is available in 1.4.4-SNAPSHOT? |
Yes and yes, so please try it out! Thanks
|
Оbviously, I was just lucky to discover this error: it did not repeat anymore even with old Javacpp. |
Workaround now included in JavaCPP 1.4.4! Thanks for reporting |
Thank you very much, Samuel! |
Yeah, I'm getting the same thing you do, but something like below works fine so I'm not sure why anyone would care so much. Just use a workaround like that. synchronized (opencv_core.class) {
final boolean haveOpenCL = opencv_core.haveOpenCL();
final boolean useOpenCL = opencv_core.useOpenCL();
System.out.println("Executor " + index + ": "
+ (useOpenCL != haveOpenCL ? "!!! STRANGE SITUATION! " : "")
+ "haveOpenCL: " + haveOpenCL + "; useOpenCL: " + useOpenCL);
try {
Thread.sleep(50);
} catch (InterruptedException ignored) {
}
} |
There is more simple workaround, that I'm using: just store this value in a constant while initializing the class :) |
I detected a strange problem while testing JavaCPP OpenCV-based functions in multi-threading mode. It occurs not frequently, but stable enough. Unfortunately, I have no a simple test for demonstrating the bug, but, maybe, you will be able to understand, what can be a reason, from the stack-trace.
The bug occurs in a simple method:
It occurs while (!!) creating the point "anchor". The stack trace:
The line Blur.java:70 is the following:
try (opencv_core.Point anchor = new opencv_core.Point(-1, -1)) {
The exception is thrown while initializing the class Point, in Loader.load method:
My Java is jdk1.8.0_181, OS - Windows 8.1.
Do you have any ideas, what could be reasons of such behavior? Is there any way to avoid such problem?
The text was updated successfully, but these errors were encountered: