There is a package called "thread-utils" which claims error safe
looping threads.
https://pkgs.racket-lang.org/package/thread-utils
*Disclaimer* I have never tried it.
I can think of a some possible implementations, but they all involve
monitoring by a separate thread (which could be the main thread).
Channels aren't necessary - monitoring can be done using events.
Restarting a (possibly failed) computation IN a running thread is
relatively simple - if you know what errors or events might occur. The
problem is that a thread can't restart itself if somehow it gets
suspended or killed.
George