Clarify unix.mapshared versus file locks (#1355)
Some checks are pending
build / matrix_on_mode () (push) Waiting to run
build / matrix_on_mode (optlinux) (push) Waiting to run
build / matrix_on_mode (rel) (push) Waiting to run
build / matrix_on_mode (tiny) (push) Waiting to run
build / matrix_on_mode (tinylinux) (push) Waiting to run

This commit is contained in:
Björn Buckwalter 2025-02-08 09:48:38 +01:00 committed by GitHub
parent 7f6a7d6fff
commit 12cb0669fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4864,9 +4864,9 @@ UNIX MODULE
end
It's possible to accomplish the same thing as unix.mapshared()
using files and unix.fcntl() advisory locks. However this goes
significantly faster. For example, that's what SQLite does and
we recommend using SQLite for IPC in redbean. But, if your app
using files and unix.fcntl() advisory locks. For example, that's
what SQLite does and we recommend using SQLite for IPC in redbean.
However, unix.mapshared is significantly faster and if your app
has thousands of forked processes fighting for a file lock you
might need something lower level than file locks, to implement
things like throttling. Shared memory is a good way to do that