Loading ...
Sorry, an error occurred while loading the content.

Re: [linux-dell-laptops] suspending a process

Expand Messages
  • Paul V. Gratz
    ... How much pain do you want to go through :-)? If you REALLY need to do this you could look into the swsusp code and make your own kernel module to do this
    Message 1 of 8 , Apr 17, 2006
    • 0 Attachment
      > --- Deepan Chakravarthy <codeshepherd@...> wrote:
      >
      > > Hi,
      > > Is is possible to suspend a single process and continue it again. I am
      > > not speaking about ctrl+z .. Basically a suspend option that allows to
      > > take snapshot of the entire process and allows you to start later , even
      > > after *reboot* .. GDB allows a core dump, but i am not sure if it
      > > allows you to load a core dump file again and start from the moment
      > > where you left before. If someone knows how to go about this please
      > > let me know.
      > > Thanks
      > > Deepan
      > > www.codeshepherd.com
      > >


      How much pain do you want to go through :-)? If you REALLY need to do
      this you could look into the swsusp code and make your own kernel
      module to do this for particular processes. It should be possible,
      considering that they have to do this for all running processes when
      the swsusp code kicks in to do a freeze before suspending the laptop.
      Might be a fun project if you are a kernel hacker. Another approach
      is to look at the "Condor" stuff which is a system for distributing
      jobs across a compute pool. One of its options is to allow process
      migration from machine to machine when machines become overloaded. I
      believe the way this is done is through a special C library that is
      linked in. This library implements a special signal to checkpoint the
      process to disk.

      Neither of these approaches are push button but you could do it if you
      needed to.
      Paul
    • Daevid Vincent
      I second the VM idea. I do a lot of LAMP work, and I use VMWare. The player is free now (not sure if it allows for suspend or not), but VMWare is by far one of
      Message 2 of 8 , Apr 17, 2006
      • 0 Attachment
        I second the VM idea. I do a lot of LAMP work, and I use VMWare. The player is free now (not sure if it allows for suspend or not), but VMWare is by far one of the coolest programs/tools I've ever seen and well worth the minimal charge. It is mature and solid.
         
        It's quite fast to "pause" and "start" a VM, plus with the "snapshot" feature, you can have different versions all in the same VM -- extremely useful for testing your program(s).
         
        Another benefit is that you can then copy that VM to another computer without worrying about anything other than it having VMWare on it. No external drivers or compatibility issues to contend with. Also perfect for backing-up.
         
        And finally, depending on your program, you won't have to worry about crashing your real OS or any kind of security issues. Nothing sucks more than developing something and locking up your computer and having to reboot -- loosing all your work in the process. ugh! With the VM. If you're unsure, just snapshot before you run your application. If it blows up. No biggie. Restart the VM, load the snapshot, tweak your code, and try again. :)

        "You had me at EHLO" --E.Webb (10.04.05)

         


        From: linux-dell-laptops@yahoogroups.com [mailto:linux-dell-laptops@yahoogroups.com] On Behalf Of Haedn Thorn
        Sent: Monday, April 17, 2006 5:26 AM
        To: linux-dell-laptops@yahoogroups.com
        Subject: Re: [linux-dell-laptops] suspending a process

        You could maybe do such a thing if you are running the process on a VM. But a
        core dump will give you the state of the system with ALL the processes which
        are running at the time, not just the one you are interested in. Trying to
        restore the machine state to regain one process would be very problematic as so
        many other things change between execution times.

        _haedn

        --- Deepan Chakravarthy <codeshepherd@...> wrote:

        > Hi,
        >   Is is possible to suspend a single process and continue it again. I am
        > not speaking about ctrl+z .. Basically a suspend option that allows to
        > take snapshot of the entire process and allows you to start later , even
        > after *reboot* ..  GDB allows a core dump, but i am not sure if it
        > allows you to load a core dump file again and start from the moment
        > where you left before.   If someone knows how to go about this please
        > let me know.
        > Thanks
        > Deepan
        > www.codeshepherd.com
        >
        >
        >
        > --------------------------------------------------------------
        > Please post your X config files in the group links or database
        > To unsubscribe, email: linux-dell-laptops-unsubscribe@yahoogroups.com
        > FAQ: http://www.whacked.net/ldl/faq
        > Yahoo! Groups Links
        >
        >
        >

        >
        >
        >

      • parenthetically_yours
        Haedn ... processes which ... Trying to ... problematic as so ... The first part of what you say is not true - a core dump relates only to the single process
        Message 3 of 8 , Apr 18, 2006
        • 0 Attachment
          Haedn

          > But a
          > core dump will give you the state of the system with ALL the
          processes which
          > are running at the time, not just the one you are interested in.
          Trying to
          > restore the machine state to regain one process would be very
          problematic as so
          > many other things change between execution times.

          The first part of what you say is not true - a core dump relates only
          to the single process it was created from. The second part is true -
          suspending a process and restarting it is only possible in trivial
          cases where there are no files open (for example) and no devices in
          use. If you can write your process to those constraints then it is
          possible to suspend and restart individual processes - just reverse
          the core dump process. This has been done before (here's a link):

          http://sourceware.org/ml/gdb/2005-11/msg00050.html

          If you can change the process to fit the constraints then you might
          find that there is less work to save the process' state in some other
          was and avoid the hassle of restarting from a core dump.

          If you try it, good luck, and be sure to tell us of your success

          /PY
        • herman@aeronetworks.ca
          First off: I have not actually followed this thread, so I am kinda jumping in sideways here... Maybe you need to look at Bash job control:
          Message 4 of 8 , Apr 18, 2006
          • 0 Attachment
            First off: I have not actually followed this thread, so I am kinda jumping in sideways here...

            Maybe you need to look at Bash job control: linux-dell-laptops@yahoogroups.com
            and this: http://www.lugbz.org/content/sections/workshops/bash-intro-2003-04-26/slide_nohup.html

            The job control commands that are nice to know are:
            ctrl-z
            bg
            fg
            jobs
            &
            nohup
            nice
            renice
            kill

            Of course, job control only works under a job control capable shell, which is one reason why Bash is popular.

            Cheers,

            Herman
          • Haedn Thorn
            ... Forgive my misinformation. I made an assumption based on some indirectly related information. ... This topic has become much more interesting :-) _haedn
            Message 5 of 8 , Apr 18, 2006
            • 0 Attachment
              --- parenthetically_yours <ygd800@...> wrote:

              > The first part of what you say is not true - a core dump relates only
              > to the single process it was created from. The second part is true -
              > suspending a process and restarting it is only possible in trivial
              > cases where there are no files open (for example) and no devices in
              > use. If you can write your process to those constraints then it is
              > possible to suspend and restart individual processes - just reverse
              > the core dump process. This has been done before (here's a link):
              >
              > http://sourceware.org/ml/gdb/2005-11/msg00050.html


              Forgive my misinformation. I made an assumption based on some indirectly
              related information. ... This topic has become much more interesting :-)

              _haedn
            • Daniel Mahler
              Ufortunately I do not remember the reference, but, by pure coincindence, I just recently read somewhere that the current Fortran standard specifies this
              Message 6 of 8 , Apr 18, 2006
              • 0 Attachment
                Ufortunately I do not remember the reference,
                but, by pure coincindence, I just recently read somewhere
                that the current Fortran standard specifies this feature.
                However, Fortran, is not my spciality, so that's all I know.

                I believe that the Elk scheme interpreter also could save out
                an image which would resume from the point where the savecall was madel.
                ie it saved out stack state and local environment etc not just glbal
                definitions,
                which is what most other lisp like systems save out when they wrrite an image..
                Being Scheme it was done with continuations.

                Daniel

                On 4/18/06, Haedn Thorn <lordhaedn@...> wrote:
                >
                >
                > --- parenthetically_yours <ygd800@...> wrote:
                >
                > > The first part of what you say is not true - a core dump relates only
                > > to the single process it was created from. The second part is true -
                > > suspending a process and restarting it is only possible in trivial
                > > cases where there are no files open (for example) and no devices in
                > > use. If you can write your process to those constraints then it is
                > > possible to suspend and restart individual processes - just reverse
                > > the core dump process. This has been done before (here's a link):
                > >
                > > http://sourceware.org/ml/gdb/2005-11/msg00050.html
                >
                >
                > Forgive my misinformation. I made an assumption based on some indirectly
                > related information. ... This topic has become much more interesting :-)
                >
                > _haedn
                >
                >
                > --------------------------------------------------------------
                > Please post your X config files in the group links or database
                > To unsubscribe, email: linux-dell-laptops-unsubscribe@yahoogroups.com
                > FAQ: http://www.whacked.net/ldl/faq
                > Yahoo! Groups Links
                >
                >
                >
                >
                >
                >
                >
                >
              Your message has been successfully submitted and would be delivered to recipients shortly.