From: Stephen D. <sd...@gm...> - 2006-04-19 19:18:48
|
On 4/19/06, Vlad Seryakov <vl...@cr...> wrote: > It is thread storage but in case of conn thread which never ends, > cleanup needs to be performs as with Ns_Cls* Hmm, an eviction policy -- sounds like a thread local Ns_Cache... Or, if cleanup is performed at the end of conn processing, as with Ns_Cls, and a conn runs in a single thread until completion, how is it different to Ns_Cls? If any one's interested in looking into thread local caches: I was thinking that this could be pushed down into the C API. But I don't know if this makes sense. More checking of how the ADP code uses thread local caches for Tcl code needs to be done. We could add a flags option NS_CACHE_THREAD_LOCAL or whatever to Ns_CacheCreate(). Ns_CacheLock/Unlock could depend on this flag. One thing I looked at is gathering stats in the thread local cache and then periodically flushing them to some common structure. I think there's an example of this in the cache code I posted to the SF tracker. Unfortunately you can't keep it completely in the C layer, as you'd like to optimise Tcl by storing Tcl objects directly, rather than stringifying them. |