3 ms·
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. Seem
by Ididntdothis 6y ago
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.
- firethief 6y agoThe 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.
- pornel 6y agoYou 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.