From: Alexandre F. <ale...@gm...> - 2012-11-22 13:27:47
|
On Thu, Nov 22, 2012 at 10:44 AM, Trevor Davel (Twylite) <tw...@cr...> wrote: > Another approach may be to have a class of Tcl_Obj that is intended to be shared between interps, and which has performance penalties associated with its management (alloc, free, modify refCount) but not its use (which gets a bit tricky if another thread tries to free it...). The problem is that even if you define a "global switch" meaning "when I'm on, disable the local allocator", you may still need to *refer* to existing values of unconstrained origin: set x [expr {rand()}] ;# <- local alloc global_alloc_only { set l [list foo ... $x ... ] ;# <- global alloc } ::thread::send $t2 $l In this case, $l will only be superficially in the proper pool; some of its element values will still be in the local one. This means that global_alloc_only is not enough (hence, in this case, useless ;) : we need a DeepCloneToGlobalArea. -Alex |