-
Notifications
You must be signed in to change notification settings - Fork 89
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
DoubleFFT_1D creating non-daemon threads causes return from main() to wait #14
Comments
Is this not the same as issue #2 that has a solution? |
I suppose this is the same issue. However, is the fix to have the API user call ConcurrencyUtils.shutdownAndAwaitTermination() or is that being done somewhere inside the library? If the former, I would argue that requiring the user to call that is not the best way to fix this issue since the user has to know about the problem and maybe even consult github. Why not just use daemon threads and avoid the complexity? If the latter, then I'm still getting the problem. |
I am new to java so I cannot comment on different types of threads :) I only noticed the closed issue resembling this one and thought I would highlight it. But I agree, my code too took a long time to exit (different from the freeze issue I just submitted) and only when checking the closed issues to make sure I was not submitting an existing issue did I come across this - at least partial - solution. |
I came across the same issue and was about to open a new issue. For me the non daemon threads are spawned once I use a large array (e.g. 256 x 256). Calling What you can do is providing your own thread pool/factory by calling Still the issue remains that once your thread pool shuts down it will be replaced by the default implementation again upon submitting a new task. This can be counteracted by reflection. Overall this entire "issue" isn't really pretty to solve without changing the actual code. |
I am doing the following (deep down in my main())
and when my main() returns it hangs for about 60 seconds before actually exiting the JVM. If I comment out the last line, the problem goes away. I think this is because ConcurrencyUtils uses Executors default thread factory which creates non-daemon threads.
Should you be using daemon threads.
The text was updated successfully, but these errors were encountered: