On Fri, May 2, 2008 at 6:46 PM, Rick Cobb <[EMAIL PROTECTED]> wrote: > > Just to add something to the discussion: One point I think is confusing > about the C API, and needs more amplification in the documentation, is > the asymmetry between Ns_TclAllocateInterp and Nn_TclDeAllocateInterp. > In our C/C++ modules, we often need to "get the current interp and run > this Tcl command", which may cause recursion back into our module(s). > And our module can be used from either conn threads or non-conn (timer, > multicast reception, etc) threads. We don't want to leak Interps, but we > also don't want to leak ns_sets and other interp-specific Tcl contexts > that should be cleaned up between requests.
Allocate single interp per-server per-thread: http://sourceforge.net/tracker/index.php?func=detail&aid=1241351&group_id=130646&atid=719006 Here's the history of nsd/tclinit.c for naviserver and aolserver, if you're looking to compare/port etc. Both have seen lots of changes but have been kept reasonably well in synch. http://freehg.org/u/groks/naviserver/log/fad41c08d28b/nsd/tclinit.c http://freehg.org/u/groks/aolserver/log/9a2383ff0ca5/nsd/tclinit.c (The above are cleaned up conversions of the cvs repos. It's easier to browse history) -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.