It is ancient wisdom that you will never be able to sensibly forcefully kill a system thread. Try to design your system such that it is not necessary. You may want to use processes instead of threads, or you may just need to make a loop in the thread checking a queue for a message that it should stop. Or you may just need to forcefully restart the whole program if you need to cancel whatever operation is occuring.
radix
3
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Any way to remote kill an entire rayon threadpool? | 8 | 1178 | January 30, 2024 | |
| Abort asynchronous task | 11 | 6837 | October 4, 2021 | |
| Why thread termination is illegal | 4 | 195 | October 7, 2025 | |
|
Stopping a Thread
|
6 | 14756 | July 3, 2022 | |
| Clean process exit when panic occur | 3 | 1004 | November 22, 2022 |