Simple API usage

From: Neal Becker (ndbecker2_at_gmail.com)
Date: Thu Mar 22 2007 - 04:06:52 PST

  • Next message: Paul H. Hargrove: "Re: Simple API usage"
    I'm doing checkpointing periodically on a simple, single-threaded process, 
    like this:
      if (rename (name.c_str(), oldname.c_str()) != 0 and errno != ENOENT)
        die ("rename failed");
      cr_request_file (name.c_str());
      cr_enter_cs(id);
      cr_leave_cs(id);
      if (remove (oldname.c_str()) != 0 and errno != ENOENT)
        die ("remove failed");
    
    I guess this forces the process to wait until the checkpoint is complete.  I 
    wonder if I can do something more efficient?  I'd rather avoid having to mess 
    with callbacks, though.
    

  • Next message: Paul H. Hargrove: "Re: Simple API usage"