Restart my program failed ?

From: Locus Jackson (locus_jackson_at_yahoo_dot_com)
Date: Mon Jan 14 2008 - 19:54:11 PST

  • Next message: Paul H. Hargrove: "Re: Restart my program failed ?"
    Hello,
    I use blcr to checkpoint and restart my program(a single threaded application).
    But when I want to restat my program,it always failed.
    The general form of my program listed as follows:
    
             void set_checkpoint()   //use this fucntion to set a checkpoint at any time and places
           {
             ........
           }
    
           void call_restart(char* filename)  //use this function to restart my program in case it failed
           {
             ......
             system("cr_restart filename");
           }
    
           int global_number=2;       
           int main()
           {
              ......
              statement1;
              set_checkpoint();
              statement2;
              ......
              while(global_number>0)   // I want to restart my program 2 times
              {
                global_number--;
                call_restart();
               }
               statement3;
               ......
             }
    
    when I execute this program ,it  restarts  far more than two times,until it told me " Restart failed: Device or resource busy".
    In my  call_restart()  function  , I  fork  a  child  to  restart  my  program(before it restart,its parent is exited,and the pgid of the child is also set to be child's pid ),but in restart,the child which is forked is always the son of the exited parent,the parent seems to be still alive,I do not know why?
    Thank you for your help.
    
    Locus.    
             
    
    
    
    
    
          ____________________________________________________________________________________
    Never miss a thing.  Make Yahoo your home page. 
    http://www.yahoo.com/r/hs
    

  • Next message: Paul H. Hargrove: "Re: Restart my program failed ?"