Skip to content
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

Internal thread is not a daemon thread #125

Closed
michab66 opened this issue Aug 1, 2018 · 2 comments
Closed

Internal thread is not a daemon thread #125

michab66 opened this issue Aug 1, 2018 · 2 comments

Comments

@michab66
Copy link

michab66 commented Aug 1, 2018

The thread started by nrjavaserial is not declared as a daemon thread.

This results in a hanging application if the #main() operation simply returns, since non-daemon threads prevent the Java-VM from termination.

Better is to declare these threads as daemon threads.

A workaround is to call System.exit().

The thread in question is started in RXTXPort.java

@dougmeredith
Copy link

I understand that it's appealing to not have background threads block JVM exit, but I'm not sure this is a correct use of daemon threads. My understanding is that they are intended to do low-priority background tasks like garbage collection.

See this article for some information. This article talks about a potential pitfall of using daemon threads.

@michab66
Copy link
Author

michab66 commented Feb 4, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants