Skip to content
Adrian Serio edited this page Aug 17, 2017 · 4 revisions

Supported APIs

There are two use-cases that I am have thought of:

  • ...code...
    int a, b, c;
    Checkpoint<> check;
    store(check, a, b, c);
    ...code...
    
  • ...code...
    int a, b, c;
    Checkpoint<> check1;
    Checkpoint<> check2;
    Checkpoint<> check3;
    store(check1, a);
    ...code...
    store(check2, b);
    ...code...
    store(check3, c);
    ...code...
    

I do not currently support calling store multiple times on a checkpoint. Enabling this functionality would result in multi-threading issues.

A complete implementation could look like this:

  • ...code...
    int a, b, c;
    checkpoint archive("previous_data.txt");
    revive_checkpoint(archive, a, b, c);
    ...code...
    hpxio_file backup_file("backedup_data.txt");
    checkpoint backup = save_checkpoint(a, b, c);
    backup_file.write(backup);
    

Futurized it would look like this:

  • ...code...
    int a, b, c;
    checkpoint archive("previous_data.txt");
    revive_checkpoint(archive, a, b, c);
    ...code...
    hpxio_file backup_file("backedup_data.txt");
    hpx::future<checkpoint> backup = save_checkpoint(a, b, c);
    backup_file.write(backup.get());
    

Clone this wiki locally