The way it works is simple. When you want to do a disk operation, first, you write down in a special place (called a journal) what you are going to do, at a high level. "I'm going to delete this directory and all its files." Then, you go through the steps of actually doing that. Finally, you record in your journal that's what you did.
Now when power is interrupted during a disk operation you simply look at the journal and you can complete any operations that were in-flight at the time of the interruption. For example if the journal says "Delete X folder" and you see it still exists, now you can pick up where you left off.
The application to interruptible programming is straightforward. I have an actual paper journal and I will in a few words explain a task to the journal before I begin. Often I end up with a hierarchical journal, like
get the unit tests to pass
the unit test doesn't pass on OSX because postgres isn't running
start postgres
the unit test doesn't pass on Linux because the postgres credentials are wrong
refactor postgres credentials to work right on both platforms
one particular Linux machine still doesn't work
Is it 32-bit related?
No
Are we using the same compiler on that machine?
The overhead of recording this information is microscopic, and the benefit of returning from every interruption to a page or so of context is awesome. It's almost better to be interrupted now, because I come back to a clearly defined problem, as opposed to starting on "blank slate" items with no direction.As a side benefit, I now write really good commit messages, because I just write what my journal says I did. Which is quite a lot more detail than it was when I was trying to remember things after the fact.