knossos
knossos copied to clipboard
Supercube (subset) lock
At the moment the supercube can be invalidated at any given moment. This has been OK so far because the user knew what he was doing so he didn't care for some blackouts. Now that we have some automation in accessing data (overlay, and in the future hopefully also raw), we cannot afford losing touch with the cubes while accessing them. Therefore one should be able to lock at least some of them. As memory and design prevent the allocation of additional cubes to compensate for the locked ones, this probably means simply locking the supercube.
I assign My-Tien, because the solution may have to be channel-aware.
Implementation detail: Locking the cube2pointer doesn't cut it, as it only protects the integrity of the coordinate->memory hash, nothing actually logic. For example, if the loader already invalidated snappy cache of a cube, it doesn't help that the hash itself still includes the cube. In addition, the lock has to be reentrant to allow first locking it to logically lock the SC, then locking it again while actually accessing the SC.