pharo-nosql / OmniBase

OmniBase is Smalltalk efficient objects repository, BTree and filesystem based with full ACID features
MIT License
8 stars 3 forks source link

[WIP] Introduce image wide lock registry #19

Closed noha closed 2 years ago

noha commented 2 years ago

The original omnibase relied locking completely on filesystem locking. In the windows systems back then locking was always mandatory, meaning the full file was locked. Early users of omnibase fiddled with the mandatory locking option in linux systems. The semantics of fcntl() in *nix systems is that it is capable of locking resources between processes. This means two processes locking the same resource will fail. But the semantics are as well that within a process you cannot have that lock because it is expected that the process knows better how to organize concurrency. This PR is an attempt to move locks from within a transaction to a global image structure. This can then be checked and locking conflicts can be detected before going to disk. This will then also work if multiple omnibase instances trying to lock the same object. The management is per filesystem path because locking refers to all objects below the root directory of a single omnibase