-
-
Notifications
You must be signed in to change notification settings - Fork 30.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multiprocessing: use SysV semaphores on FreeBSD #54557
Comments
Support POSIX semaphore on FreeBSD is recent, optional (eg. disabled by default in FreeBSD 7) and limited (30 semaphores). SYSV should be used instead because they are less limited or more adjustable (at runtime: POSIX semaphore requires to recompile the kernel!). This issue should fix test_concurrent_futures on FreeBSD 7.2 and 8.0: many tests use more than 30 semaphores. The maximum is test_all_completed_some_already_completed: 52 semaphores. |
It looks like SysV semaphores are also preferred on Darwin. So I suppose that Mac OS X would also benefit of this issue. Maybe also other OSes (Solaris?). See also issue bpo-7272. |
Informations about SysV semaphores:
|
Examples of programs using SysV semaphores: http://firebird.cvs.sourceforge.net/viewvc/firebird/firebird2/src/jrd/isc_sync.cpp?revision=HEAD&view=markup https://github.com/mono/mono/blob/master/mono/io-layer/shared.c#L501 |
See also bpo-5725. |
See also http://semanchuk.com/philip/sysv_ipc/: "System V IPC for Python - Semaphores, Shared Memory and Message Queues" |
Adding, or moving, to SYSV semaphores is very low on the list of things to do. If someone were to provide a patch, I'm sure we could consider it. |
More info about FreeBSD. "sysctl p1003_1b.sem_nsems_max" gives the maximum number of POSIX semaphores (per process? system wide?). Since FreeBSD 8.1, "sudo sysctl -w p1003_1b.sem_nsems_max=256" can be used to change this limit at runtime. Before FreeBSD 8.1, SEM_MAX constant should be changed in the kernel source code, and the kernel have to be recompiled. (p1003_1b.sem_nsems_max is not configurable in /etc/sysctl.conf, it is an hardcoded limit). Before FreeBSD 8.0, the POSIX semaphores are disabled by default: the kernel have to be compiled using P1003_1B_SEMAPHORES option. Extract of sys/conf/NOTES: ##################################################################### # Real time extensions added in the 1993 POSIX options _KPOSIX_PRIORITY_SCHEDULING # POSIX message queue |
NetBSD. Extract of the sem_close() manpage HISTORY Martin wrote on the mailing list: SEM_MAX is 128 since 2007, and dynamically adjustable (no reboot). It looks like the sysctl (read/write) option is kern.posix.semmax. |
Darwin (Mac OS X). According to the following email (July 2010), Darwin supports POSIX semaphores and the default limit is 10,000 semaphores. The limit is configurable via sysctl as kern.posix.sem.max. |
OpenBSD. According to Martin, OpenBSD doesn't implement POSIX semaphores. In FreeBSD, POSIX semaphores are implemented in sys/kern/uipc_sem.c. http://www.openbsd.org/cgi-bin/cvsweb/src/sys/kern/ that file doesn't exist. Also, in FreeBSD's limits.h, this constant doesn't appear. So ISTM that OpenBSD doesn't implement |
Martin fixed test_concurrent_futures (bpo-10798), this issue can be implemented later. |
-1 |
Agreed with Charles-François. |
Charles and Antoine's votes match my own, therefore closing the bug wont fix |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: