Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Spawn new thread on panic
As I was writing this thread, I came up with a follow up question, which is:
Is it possible to spawn a replacement thread when one panics, always keeping the total number of threads below a defined limit?
My specific application is a web server, but I could see it for other longer running programs where rather than killing the whole app or operating with one less thread, you log the panic, and resume handling requests while restoring the total number of threads you had before.
This would allow for a more fault tolerant piece of software that can recover from bad data or actions by its users that would otherwise cause a hard crash.
Admittedly I am relatively new to multi-threaded programming so I probably have some fundamental misunderstandings here.
However, if this is possible in rust, I would be very interested!
Thanks
1 post - 1 participant
🏷️ rust_feed