summaryrefslogtreecommitdiffstats
path: root/Objects/memoryobject.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-10-04 20:35:30 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-10-04 20:35:30 (GMT)
commit5183856c177610ceddb057e3ee90fda85dc2eac1 (patch)
treec795d9ec4735ef416728f71baf418cb57a509377 /Objects/memoryobject.c
parent9507887544965b471129cded5066e0b2339eb414 (diff)
downloadcpython-5183856c177610ceddb057e3ee90fda85dc2eac1.zip
cpython-5183856c177610ceddb057e3ee90fda85dc2eac1.tar.gz
cpython-5183856c177610ceddb057e3ee90fda85dc2eac1.tar.bz2
Merged revisions 75246 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r75246 | benjamin.peterson | 2009-10-04 15:32:25 -0500 (Sun, 04 Oct 2009) | 29 lines Merged revisions 74841 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r74841 | thomas.wouters | 2009-09-16 14:55:54 -0500 (Wed, 16 Sep 2009) | 23 lines Fix issue #1590864, multiple threads and fork() can cause deadlocks, by acquiring the import lock around fork() calls. This prevents other threads from having that lock while the fork happens, and is the recommended way of dealing with such issues. There are two other locks we care about, the GIL and the Thread Local Storage lock. The GIL is obviously held when calling Python functions like os.fork(), and the TLS lock is explicitly reallocated instead, while also deleting now-orphaned TLS data. This only fixes calls to os.fork(), not extension modules or embedding programs calling C's fork() directly. Solving that requires a new set of API functions, and possibly a rewrite of the Python/thread_*.c mess. Add a warning explaining the problem to the documentation in the mean time. This also changes behaviour a little on AIX. Before, AIX (but only AIX) was getting the import lock reallocated, seemingly to avoid this very same problem. This is not the right approach, because the import lock is a re-entrant one, and reallocating would do the wrong thing when forking while holding the import lock. Will backport to 2.6, minus the tiny AIX behaviour change. ........ ................
Diffstat (limited to 'Objects/memoryobject.c')
0 files changed, 0 insertions, 0 deletions