python27 is always built with multiprocessing support on >= 9.0 or on 7.1..8.4 with sem.ko preloaded because autoconf finds working sem_open(). And python2[67] always USE_SEMAPHORES for locking which seems to work fine with libthr's sem_init(pshared=0). Fix: Just an incomplete attempt to make SEM more predictable: - remove checks for EOL releases - limit sem.ko warning and extra patches to 8.x users - warn 9.x users semaphores support cannot be disabled like in python3x - rely on autoconf to find sem_open et al. like netbsd or python3x - enable sem_open for python26 on >= 9.0 by default like python27 - don't use semaphores for locking if SEM is unset on 8.x How-To-Repeat: FreeBSD 9.0 or later: $ python3.3 -c 'import multiprocessing.synchronize' $ python2.7 -c 'import multiprocessing.synchronize' $ python2.6 -c 'import multiprocessing.synchronize' Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/local/lib/python2.6/multiprocessing/synchronize.py", line 33, in <module> " function, see issue 3770.") ImportError: This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770. FreeBSD 7.2..8.4: $ python3.3 -c 'import multiprocessing.synchronize' Traceback (most recent call last): File "/usr/local/lib/python3.3/multiprocessing/synchronize.py", line 27, in <module> from _multiprocessing import SemLock ImportError: cannot import name SemLock During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/local/lib/python3.3/multiprocessing/synchronize.py", line 32, in <module> " function, see issue 3770.") ImportError: This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770. $ python2.7 -c 'import multiprocessing.synchronize' Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/local/lib/python2.7/multiprocessing/synchronize.py", line 59, in <module> " function, see issue 3770.") ImportError: This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770. $ python2.6 -c 'import multiprocessing.synchronize' Traceback (most recent call last): File "<string>", line 1, in <module> File "/usr/local/lib/python2.6/multiprocessing/synchronize.py", line 33, in <module> " function, see issue 3770.") ImportError: This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770.
Abandoned.
Hi Jan, Now that python27 has been refactored using the new python34 baseline, and all python port OPTIONS have been made consistent, how can we further refine semaphore functionality/behaviour of the port?
Jan, Please re-open this issue if there's any improvements still to be made on the semaphore front, locally or upstream