Hacker News new | past | comments | ask | show | jobs | submit login

Would you have to keep track of these threads in Rust? I have done a lot of desktop development where you have to be aware of what happens during shutdown. Seems a lot of server guys write their code under the assumption that it will never shut down.



You would need to add `thread.join()` at the end of main, or have some RAII guard that does it for you.

In practice that's probably optional, because the heap and all resources are usually torn down with the process anyway. Important things, like saving data or committing transactions, shouldn't be done in destructors.


The answer to this question is the same for any language without a heavy runtime. You can choose to join the worker thread, detach it, or kill it.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: