From 0a96b2ad972b2ddefcbcd60fcd7329d046e4ec2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9B=D0=B5=D0=BE=D0=BD=D0=B8=D0=B4=20=D0=AE=D1=80=D1=8C?= =?UTF-8?q?=D0=B5=D0=B2=20=28Leonid=20Yuriev=29?= Date: Mon, 28 Apr 2025 14:38:38 +0300 Subject: [PATCH] =?UTF-8?q?mdbx-doc:=20=D0=B4=D0=BE=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=80=D0=B0=D0=B7=D0=B4=D0=B5?= =?UTF-8?q?=D0=BB=D0=B0=20"Containers"=20=D0=B2=20README.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 12 +++++++++--- src/lck-posix.c | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 981d6c18..1a444e5e 100644 --- a/README.md +++ b/README.md @@ -555,9 +555,9 @@ Of course, in addition to this, your toolchain must ensure the reproducibility o For more information please refer to [reproducible-builds.org](https://reproducible-builds.org/). #### Containers -There are no special traits nor quirks if you use libmdbx ONLY inside the single container. -But in a cross-container cases or with a host-container(s) mix the two major things MUST be -guaranteed: +There are no special traits nor quirks if you use _libmdbx_ ONLY inside +the single container. But in a cross-container(s) or with a host-container(s) +interoperability cases the three major things MUST be guaranteed: 1. Coherence of memory mapping content and unified page cache inside OS kernel for host and all container(s) operated with a DB. Basically this @@ -573,6 +573,12 @@ in the system memory. including `ERROR_ACCESS_DENIED`, but not the `ERROR_INVALID_PARAMETER` as for an invalid/non-existent PID. +3. The versions/builds of _libmdbx_ and `libc`/`pthreads` (`glibc`, `musl`, etc) must be be compatible. + - Basically, the `options:` string in the output of `mdbx_chk -V` must be the same for host and container(s). + See `MDBX_LOCKING`, `MDBX_USE_OFDLOCKS` and other build options for details. + - Avoid using different versions of `libc`, especially mixing different implementations, i.e. `glibc` with `musl`, etc. + Prefer to use the same LTS version, or switch to full virtualization/isolation if in doubt. + #### DSO/DLL unloading and destructors of Thread-Local-Storage objects When building _libmdbx_ as a shared library or use static _libmdbx_ as a part of another dynamic library, it is advisable to make sure that your diff --git a/src/lck-posix.c b/src/lck-posix.c index 99a01f91..1fb502a1 100644 --- a/src/lck-posix.c +++ b/src/lck-posix.c @@ -49,7 +49,7 @@ * = F_WRLCK блокировка первого байта lck-файла, другие процессы ждут её * снятия при получении F_RDLCK через F_SETLKW. * - блокировки dxb-файла могут меняться до снятие эксклюзивной блокировки - * lck-файла: + * lck-файла: * + для НЕ-эксклюзивного режима блокировка pid-байта в dxb-файле * посредством F_RDLCK или F_WRLCK, в зависимости от MDBX_RDONLY. * + для ЭКСКЛЮЗИВНОГО режима блокировка всего dxb-файла