3 ms·
Who is "you" here? There may be several processes waiting on that lock. Even if they have a reliable crash detection mechanism, they'll have to coordinate to de
by ot 6y ago
Who is "you" here? There may be several processes waiting on that lock. Even if they have a reliable crash detection mechanism, they'll have to coordinate to decide who's in charge of repairing the state. What if that process dies during the repair?
I'm not saying it's impossible, but you're basically implementing a distributed, embedded version of the lock daemon. And as all distributed things, fault-tolerance is hard. It's easier in a dedicated process or in the kernel because they're centralized (and if the kernel panics all processes stop; that can be emulated in a daemon).
- pmeunier 6y agoWhat we have to do in Pijul is even worse: in addition to all this, it must (1) be cross-platform and (2) avoid any user interaction, because Pijul is meant to be beginner-friendly.
- chrismorgan 6y agoFunny you should say cross-platform, because one of my honest concerns with something like this is what will happen if multiple computers try to operate on a shared file system simultaneously. A different kind of cross-platform, if you will. For example, I have definitely run Git commands on the same repository from both Windows and (via WSL) Linux simultaneously in the past (I used to use Windows gVim and Linux everything else, and both could invoke their platform’s Git). That’s where cross-process locking concerns me. And WSL is hardly the only type of file system that may be accessed from multiple machines simultaneously.