mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-03-27 09:11:48 -07:00
Expand the discussion of problems with synchronous finalization.
Copied from Perforce Change: 180016 ServerID: perforce.ravenbrook.com
This commit is contained in:
parent
e2b52e333e
commit
c69a7dbf0a
1 changed files with 10 additions and 8 deletions
|
|
@ -41,11 +41,14 @@ message mechanism.
|
|||
|
||||
.. note::
|
||||
|
||||
This design avoids problems that can result from the :term:`garbage
|
||||
collector` calling a function in the client program to do the
|
||||
finalization. In such an implementation, if the client program's
|
||||
finalization code needs to acquire locks, an unlucky scheduling of
|
||||
finalization can result in deadlock. See Appendix B of [BOEHM02]_.
|
||||
This design avoids the problems that can result from the
|
||||
:term:`garbage collector` calling a function in the client program
|
||||
to do the finalization. In such an implementation, the client
|
||||
program's finalization code may end up running concurrently with
|
||||
other code that accesses the underlying resource, and so access to
|
||||
the resource need to be guarded with a lock, but then an unlucky
|
||||
scheduling of finalization can result in deadlock. See [BOEHM02]_
|
||||
for a detailed discussion of this issue.
|
||||
|
||||
The :term:`message type` of finalization messages is
|
||||
:c:func:`mps_message_type_finalization`, and the finalization
|
||||
|
|
@ -228,9 +231,8 @@ Cautions
|
|||
circumstances.
|
||||
|
||||
This is why Java's ``System.runFinalizersOnExit`` is
|
||||
deprecated.
|
||||
|
||||
See Appendix A of [BOEHM02]_ for a discussion of this problem.
|
||||
deprecated. See Appendix A of [BOEHM02]_ for a discussion of
|
||||
this problem.
|
||||
|
||||
4. Not all :term:`pool classes <pool class>` support finalization. In
|
||||
general, only pools that manage objects whose liveness is
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue