A separate program that monitors the main one, and performs the restart if it crashes. If you want to keep the progress, a Process Pair might be a better solution.