Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
37040cda
Commit
37040cda
authored
Sep 30, 2008
by
Jesse Noller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
issue3770: if SEM_OPEN is 0, disable the mp.synchronize module, rev. Nick Coghlan, Damien Miller
parent
e563aa43
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
37 additions
and
0 deletions
+37
-0
Doc/library/multiprocessing.rst
Doc/library/multiprocessing.rst
+7
-0
Lib/multiprocessing/synchronize.py
Lib/multiprocessing/synchronize.py
+11
-0
Lib/test/regrtest.py
Lib/test/regrtest.py
+3
-0
Lib/test/test_multiprocessing.py
Lib/test/test_multiprocessing.py
+8
-0
setup.py
setup.py
+8
-0
No files found.
Doc/library/multiprocessing.rst
View file @
37040cda
...
...
@@ -18,6 +18,13 @@ to this, the :mod:`multiprocessing` module allows the programmer to fully
leverage
multiple
processors
on
a
given
machine
.
It
runs
on
both
Unix
and
Windows
.
..
warning
::
This
package
largely
requires
a
functioning
shared
semaphore
implementation
on
the
host
operating
system
to
function
.
Without
one
,
the
:
mod
:`
multiprocessing
.
synchronize
`
module
will
be
disabled
,
and
attempts
to
import
it
will
result
in
an
ImportError
.
See
http
://
bugs
.
python
.
org
/
issue3770
for
additional
information
.
The
:
class
:`
Process
`
class
~~~~~~~~~~~~~~~~~~~~~~~~~~
...
...
Lib/multiprocessing/synchronize.py
View file @
37040cda
...
...
@@ -21,6 +21,17 @@ from multiprocessing.process import current_process
from
multiprocessing.util
import
Finalize
,
register_after_fork
,
debug
from
multiprocessing.forking
import
assert_spawning
,
Popen
# Try to import the mp.synchronize module cleanly, if it fails
# raise ImportError for platforms lacking a working sem_open implementation.
# See issue 3770
try
:
from
_multiprocessing
import
SemLock
except
(
ImportError
):
raise
ImportError
(
"This platform lacks a functioning sem_open"
+
" implementation, therefore, the required"
+
" synchronization primitives needed will not"
+
" function, see issue 3770."
)
#
# Constants
#
...
...
Lib/test/regrtest.py
View file @
37040cda
...
...
@@ -1047,6 +1047,7 @@ _expectations = {
test_tcl
test_timeout
test_urllibnet
test_multiprocessing
"""
,
'aix5'
:
"""
...
...
@@ -1077,6 +1078,7 @@ _expectations = {
test_ossaudiodev
test_pep277
test_tcl
test_multiprocessing
"""
,
'netbsd3'
:
"""
...
...
@@ -1092,6 +1094,7 @@ _expectations = {
test_ossaudiodev
test_pep277
test_tcl
test_multiprocessing
"""
,
}
_expectations
[
'freebsd5'
]
=
_expectations
[
'freebsd4'
]
...
...
Lib/test/test_multiprocessing.py
View file @
37040cda
...
...
@@ -18,6 +18,14 @@ import socket
import
random
import
logging
# Work around broken sem_open implementations
try
:
import
multiprocessing.synchronize
except
ImportError
,
e
:
from
test.test_support
import
TestSkipped
raise
TestSkipped
(
e
)
import
multiprocessing.dummy
import
multiprocessing.connection
import
multiprocessing.managers
...
...
setup.py
View file @
37040cda
...
...
@@ -1269,6 +1269,14 @@ class PyBuildExt(build_ext):
)
libraries = []
elif platform.startswith('openbsd'):
macros = dict( # OpenBSD
HAVE_SEM_OPEN=0, # Not implemented
HAVE_SEM_TIMEDWAIT=0,
HAVE_FD_TRANSFER=1,
)
libraries = []
else: # Linux and other unices
macros = dict(
HAVE_SEM_OPEN=1,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment