Staging
v0.8.1
https://github.com/python/cpython
Revision 448db2155fc81d2aa84f37dc58683251cba8772e authored by Thomas Wouters on 16 September 2009, 20:06:36 UTC, committed by Thomas Wouters on 16 September 2009, 20:06:36 UTC
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r74841 | thomas.wouters | 2009-09-16 12:55:54 -0700 (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.
........
1 parent c5a6fd7
Raw File
Tip revision: 448db2155fc81d2aa84f37dc58683251cba8772e authored by Thomas Wouters on 16 September 2009, 20:06:36 UTC
Merged revisions 74841 via svnmerge from
Tip revision: 448db21
.hgignore
.gdb_history
.purify
.svn
BIG5.TXT
BIG5HKSCS-2004.TXT
BIG5HKSCS.TXT
CP932.TXT
CP936.TXT
CP949.TXT
CP950.TXT
EUC-CN.TXT
EUC-JISX0213.TXT
EUC-JP.TXT
EUC-KR.TXT
JOHAB.TXT
Makefile
Makefile.pre
NormalizationTest-3.2.0.txt
NormalizationTest.txt
SHIFTJIS.TXT
SHIFT_JISX0213.TXT
TAGS
autom4te.cache
build
buildno
config.cache
config.log
config.status
config.status.lineno
db_home
gb-18030-2000.xml
platform
pyconfig.h
python
python.exe
reflog.txt
tags
Lib/plat-mac/errors.rsrc.df.rsrc
Doc/tools/sphinx/
Doc/tools/docutils/
Doc/tools/jinja/
Doc/tools/pygments/
Modules/Setup
Modules/Setup.config
Modules/Setup.local
Modules/config.c
Parser/pgen
core

syntax: glob
libpython*.a
*.o
*.pyc
*.pyo
*.pyd
*.cover
*.orig
*.rej
*~
Lib/lib2to3/*.pickle
PCbuild/*.exe
PCbuild/*.dll
PCbuild/*.pdb
PCbuild/*.lib
PCbuild/*.exp
PCbuild/*.o
PCbuild/*.ncb
PCbuild/*.bsc
PCbuild/Win32-temp-*
back to top