My description was not accurate. The TCL library is sourced once when
the server boots and all procedures and statements are executed.
During server startup, a huge string is created which contains the
proc statements for all of the procedures contained in your startup
directories.
Then whenever a new thread starts, this proc string is evaluated to
define all of the TCL procedures in the new thread; but nothing is
executed other than defining the procs.
Seems like some kind of dynamic proc definition mechanism similar to
autoloading would be useful here...
Jim
>
> Jim Wilcoxson wrote:
> >
> > Another circumstance is if you have a large TCL library code base in
> > modules/tcl and make heavy use of the thread mechanism, like frequently
> > starting detached threads.
> >
> > This is no big deal with 2.3.3 because of the shared TCL interpreter,
> > but 3.X takes a huge performance hit when a thread starts (and you have
> > a large TCL library). Basically, your TCL library is sourced whenever
> > a thread starts in 3.x, but it is just "there" in 2.3.3.
>
> When you are saying "TCL library" are referring also at the tcl files in
>
> /usr/local/aolserver/servers/server1/modules/tcl ?
>
> because I have a lot of procedures there and also some startup commands
> that must be run only once for one AOL server (opening database and
> build a huge cache with information that need to be fetched almost
> instantly).
>
> Constantin Teodorescu
>