https://bugs.openldap.org/show_bug.cgi?id=9372
Issue ID: 9372 Summary: Use POSIX semaphores by default on MacOS Product: LMDB Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: --- Component: liblmdb Assignee: bugs@openldap.org Reporter: kriszyp@gmail.com Target Milestone: ---
Created attachment 775 --> https://bugs.openldap.org/attachment.cgi?id=775&action=edit Set POSIX semaphore as default for MacOS
On Apple/MacOS, System V semaphores have a limit of 10 open robust (SEM_UNDO) semaphores at once per process, which can cause problems if a process has many open database environments/transactions open at once. Using POSIX semaphores eliminates this problems and supposedly have a little bit better performance. The attached patch (also at https://github.com/kriszyp/lmdb/commit/0971512f6a4aa5b05f99e481a6687d4802f70...) sets that as the default, and reverts back to System V semaphores with MDB_USE_ROBUST, since MacOS does not support robust POSIX locking.