Index: openacs-4/packages/xotcl-core/tcl/40-thread-mod-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/40-thread-mod-procs.tcl,v diff -u -r1.6 -r1.7 --- openacs-4/packages/xotcl-core/tcl/40-thread-mod-procs.tcl 31 May 2007 20:17:34 -0000 1.6 +++ openacs-4/packages/xotcl-core/tcl/40-thread-mod-procs.tcl 13 Jul 2007 16:44:38 -0000 1.7 @@ -102,7 +102,7 @@ # -parameter {{persistent 0}} Class create ::xotcl::THREAD \ - -parameter {{persistent 0}} + -parameter {{persistent 0} {lightweight 0}} #Class create ::xotcl::THREAD \ # -parameter {{persistent 0}} @@ -198,15 +198,21 @@ #my check_blueprint #my log "after lock" if {![nsv_exists [self class] [self]]} { - set tid [::thread::create] + if {[my lightweight]} { + my log "CREATE lightweight thread" + set tid [::thread::create -thin] + } else { + set tid [::thread::create] + } nsv_set [self class] [self] $tid if {[my persistent]} { my log "--created new persistent [self class] as $tid pid=[pid]" } else { my log "--created new [self class] as $tid pid=[pid]" } #my log "--THREAD DO send [self] epoch = [ns_ictl epoch]" - if {![ns_ictl epoch]} { + if {[my lightweight]} { + } elseif {![ns_ictl epoch]} { #ns_log notice "--THREAD send [self] no epoch" # We are during initialization. For some unknown reasons, XOTcl # is not available in newly created threads, so we have to care @@ -215,7 +221,7 @@ set initcmd [ns_ictl get] } append initcmd [my set initcmd] - + ns_log notice "INIT $initcmd" ::thread::send $tid $initcmd } else { set tid [nsv_get [self class] [self]]