Index: openacs-4/packages/acs-tcl/tcl/acs-cache-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/acs-cache-procs.tcl,v diff -u -r1.10.2.14 -r1.10.2.15 --- openacs-4/packages/acs-tcl/tcl/acs-cache-procs.tcl 14 Feb 2021 21:04:55 -0000 1.10.2.14 +++ openacs-4/packages/acs-tcl/tcl/acs-cache-procs.tcl 24 Sep 2021 11:31:03 -0000 1.10.2.15 @@ -373,7 +373,7 @@ namespace eval ::acs { ########################################################################## # - # acs::LockfreeCache: Per-thread and per-request Cache + # ::acs::LockfreeCache: Per-thread and per-request Cache # # Lockfree cache are provided either as per-thread caches or # per-request caches, sharing the property that accessing these @@ -399,7 +399,7 @@ # the flush values in every thread. # ########################################################################## - nx::Class create acs::LockfreeCache { + nx::Class create ::acs::LockfreeCache { :property {prefix} :public method get { @@ -477,18 +477,33 @@ } } } + # - # The per-thread cache uses namespaced Tcl variables, identified - # by the prefix "::acs:cache::" - # - :create per_thread_cache -prefix ::acs::cache - - # # The per-request cache uses Tcl variables in the global # namespace, such they are automatically reclaimed after the - # request. These use the prefix "::__acs_cache_" + # request. These use the prefix "::__acs_cache" # :create per_request_cache -prefix ::__acs_cache + + # + # Define the "per_thread_cache" + # + if {[ns_config "ns/parameters" cachingmode singlenode] eq "none"} { + # + # If caching mode is "none", let the "per_thread_cache" behave + # like the "per_request_cache". + # + :create per_thread_cache -prefix ::__acs_cache + ns_log notice "cachingmode [ns_config "ns/parameters" cachingmode singlenode]" \ + "-> per_thread_cache behaves like per-request_cache" + + } else { + # + # The per-thread cache uses namespaced Tcl variables, identified + # by the prefix "::acs:cache" + # + :create per_thread_cache -prefix ::acs::cache + } } namespace eval ::acs::cache {} }