• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Running a time consuming background process
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running a time consuming background process


  • Subject: Re: Running a time consuming background process
  • From: Terry Lambert <email@hidden>
  • Date: Tue, 29 Jan 2008 00:10:36 -0800

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:
This email sent to email@hidden


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

  • Prev by Date: Re: [Fwd: Re: execv bug???]
  • Next by Date: Program not exiting
  • Previous by thread: Re: Running a time consuming background process
  • Next by thread: Re: Running a time consuming background process
  • Index(es):
    • Date
    • Thread