Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running a time consuming background process



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.).

For example:

	cat /tmp/foo | my_batch_program

How would you reopen descriptor 0 at the right place?

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.

-- Terry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden
References: 
 >Running a time consuming background process (From: Tommy Nordgren <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.