2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-19 04:22:16 +00:00

add pyfinalize safety

[SVN r20022]
This commit is contained in:
Dave Abrahams
2003-09-11 11:07:05 +00:00
parent e78b4939b3
commit 3b74aab818
2 changed files with 32 additions and 2 deletions

View File

@@ -50,6 +50,7 @@
<li><a class="reference" href="#langbinding" id="id20" name="id20">Langbinding</a></li>
<li><a class="reference" href="#refactoring-and-reorganization" id="id21" name="id21">Refactoring and Reorganization</a></li>
<li><a class="reference" href="#numarray-support-enhancements" id="id22" name="id22">NumArray Support Enhancements</a></li>
<li><a class="reference" href="#pyfinalize-safety" id="id23" name="id23"><tt class="literal"><span class="pre">PyFinalize</span></tt> Safety</a></li>
</ul>
</li>
</ul>
@@ -174,12 +175,26 @@ languages, initially Lua. See discussions at
Consider integrating the enhancements described in
<a class="reference" href="http://aspn.activestate.com/ASPN/Mail/Message/C++-sig/1757092">http://aspn.activestate.com/ASPN/Mail/Message/C++-sig/1757092</a></blockquote>
</div>
<div class="section" id="pyfinalize-safety">
<h2><a class="toc-backref" href="#id23" name="pyfinalize-safety"><tt class="literal"><span class="pre">PyFinalize</span></tt> Safety</a></h2>
<blockquote>
<p>Currently Boost.Python has several global (or function-static)
objects whose existence keeps reference counts from dropping to
zero until the Boost.Python shared object is unloaded. This can
cause a crash because when the reference counts <em>do</em> go to zero,
there's no interpreter. In order to make it safe to call
<tt class="literal"><span class="pre">PyFinalize()</span></tt> we must register an <tt class="literal"><span class="pre">atexit</span></tt> routine which
destroys these objects and releases all Python reference counts
so that Python can clean them up while there's still an
interpreter. <a class="reference" href="mailto:dirk-at-gerrits.homeip.net">Dirk Gerrits</a> has promised to do this job.</p>
</blockquote>
</div>
</div>
</div>
<hr class="footer"/>
<div class="footer">
<a class="reference" href="todo.txt">View document source</a>.
Generated on: 2003-08-26 15:49 UTC.
Generated on: 2003-09-11 11:04 UTC.
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>
</body>

View File

@@ -71,7 +71,6 @@ Injected Constructors
Type Converters
===============
@@ -152,3 +151,19 @@ NumArray Support Enhancements
Consider integrating the enhancements described in
http://aspn.activestate.com/ASPN/Mail/Message/C++-sig/1757092
``PyFinalize`` Safety
---------------------
Currently Boost.Python has several global (or function-static)
objects whose existence keeps reference counts from dropping to
zero until the Boost.Python shared object is unloaded. This can
cause a crash because when the reference counts *do* go to zero,
there's no interpreter. In order to make it safe to call
``PyFinalize()`` we must register an ``atexit`` routine which
destroys these objects and releases all Python reference counts
so that Python can clean them up while there's still an
interpreter. `Dirk Gerrits`_ has promised to do this job.
.. _`Dirk Gerrits`: mailto:dirk-at-gerrits.homeip.net