Re: Running a time consuming background process
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com For example: cat /tmp/foo | my_batch_program How would you reopen descriptor 0 at the right place? -- Terry _______________________________________________ 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... On Jan 27, 2008, at 10:56 AM, Tommy Nordgren wrote: 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. It's called checkpoint/restart, and you can do it in user space using an appropriate third party library (such as "Libtckpt"). There are bunches of other options, but that the first one that comes up in google, and it's one I played with once upon a time. This is not a service offered by the OS, since it has no idea what passwords you used for all your network connections, network shares, or how to reopen some types of decriptors (e.g. those to named pipes in /var/run or /tmp, which no longer exist, socket connections to servers that are now down or were over a VPN that you didn't start back up, firewire disks that have since been unplugged from the machine, etc.). This is a case where you are up against the halting problem, and it's better to use a library and constrain your applications behaviour to only those things that the library knows how to restart, rather than trying to solve the problem generally for all possible applications. This email sent to site_archiver@lists.apple.com
participants (1)
-
Terry Lambert