D 2014-08-28T17:41:45.594 L Preservation P e066382c0189a52e6d52623393cd8d7e44a8e68f U dgp W 1143

Source Files

* [/finfo?name=generic/tclPreserve.c|tclPreserve.c]

Public Routines

* Tcl_Preserve * Tcl_Release * Tcl_EventuallyFree

Private Routines

* TclFinalizePreserve * TclHandleCreate * TclHandleFree * TclHandlePreserve * TclHandleRelease

Directly Depends On Public Routines From

* [Threads] * [Embedding Support] * [Allocation]

Directly Depends On Private Routines From

* None

Discussion

This module provides a solution to the important problem of managing shared interest in allocated memory. Use of mutexes is needed to be safe for general use, but harms performance. Implementation as a linear scan suggests the solution does not scale well at all. An effort to examine alternatives was made in [/timeline?r=novem-ak-preserve-experiments|novem-ak-preserve-experiments]. Wherever thread isolation and refcounting can be employed instead, they probably ought to be. Completely different approaches such as some kind of garbage collection scheme might also avoid the drawbacks here. Z ff8dcae5ba874bc8cd47caa9849ca4af