Re: Running a time consuming background process
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Organization: HoffmanLabs LLC User-agent: Thunderbird 2.0.0.9 (Macintosh/20071031) _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... I need to run a custom program that I expect to need several weeks of (wall clock) time to complete. How can I set up and run so that I can save state on any signal, and having my program automatically resumed on start up, with as little extra work as possibly when resuming. My program is a pure batch job, by the way. Why not checkpoint your progress and your run-time state on a periodic basis? This approach is simple, easier to verify, and catches a hard power-down and most anything else. In my experience, there are cases where catching errors can be too clever by half. What happens if you catch an error that means you can't, for instance, write? How and what to checkpoint varies greatly, based on what you are doing. Transactional processing and databases work well here for a subset of the possible cases. This is less efficient (proportional to the quantity of data and the frequency of the checkpoints), but this approach is also easier to code, test and maintain. This email sent to site_archiver@lists.apple.com
participants (1)
-
Stephen Hoffman