[Python-checkins] python/dist/src/Doc/api newtypes.tex,1.28,1.29

loewis at users.sourceforge.net loewis at users.sourceforge.net
Sun Feb 15 16:01:21 EST 2004


Update of /cvsroot/python/python/dist/src/Doc/api
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23134

Modified Files:
	newtypes.tex 
Log Message:
Patch #893566: Document that tp_dealloc may be called from any thread.


Index: newtypes.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/api/newtypes.tex,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** newtypes.tex	13 Dec 2003 11:26:10 -0000	1.28
--- newtypes.tex	15 Feb 2004 21:01:17 -0000	1.29
***************
*** 1390,1393 ****
--- 1390,1403 ----
  \end{cmemberdesc}
  
+ Also, note that, in a garbage collected Python, tp_dealloc may be
+ called from any Python thread, not just the thread which created the
+ object (if the object becomes part of a refcount cycle, that cycle
+ might be collected by a garbage collection on any thread).  This is
+ not a problem for Python API calls, since the thread on which
+ tp_dealloc is called will own the Global Interpreter Lock (GIL).
+ However, if the object being destroyed in turn destroys objects from
+ some other C or C++ library, care should be taken to ensure that
+ destroying those objects on the thread which called tp_dealloc will
+ not violate any assumptions of the library.
  
  \section{Mapping Object Structures \label{mapping-structs}}




More information about the Python-checkins mailing list