On Wed, 25 Apr 2001, Dietz, Phil E. wrote:

> Going through the source it appears I just setup the handler:
>       AddHandler tcl-handler *.tcl *.cgi
> And it should do'er.
>
> I guess my point being the lack of docs :-)

That should work, when the content handler is run it just checks to see if
the handler being called matches `tcl-handler'.  I've never used it with
filetype matching before, I usually use SetHandler in a directory....

The documentation is lacking :( as soon as I fix up some stuff probably by
0.9 I'll then start on docs and then 1.0.  The NEWS file kind of has a
roadmap.

>
> ! Awesome !
>
> I tried to write something similar (probably without so many features!!)
> once.
> During my benchmarking it ran slower.  Probably because the apache children
> were so big with TCL statically linked in it (making the httpd executable 3
> or 4 megs each).
>
> One feature I was going to try was cacheing the most popular *.cgi scripts
> by using Multiple Interpreters....one for each cgi script.  Then you
> wouldn't have to read the cgi or re-parse it.  Maybe I'll try it on yours.
>
> Any thoughts ?
> Phil

Well actually this is already being done.  There is 1 interpreter for each
Apache child (on my machine with Apache 2.0 basically just one httpd
handles everything, with a root httpd running to monitor crashes.. or just
kill and restart, which Apache likes to do anyways).  When a user requests
a URI, the run_handler will check the file and see if it is loaded, if not
it will be loaded into the interpreter.  If the file has changed it will
be reloaded.  This is all accompilished with the stat() system call to
check modification times on the filesystem.  Otherwise the
`content_handler' is run from memory.  And since the interpreter keeps all
the previous loaded stuff in memory (in byte code) everything is run from
main memory and the file system isn't touched.

You might be asking "what about file proc and variable collisions", those
are not a problem because each file is loaded into its own namespace and
executed in that namespace.  Thus reducing the complexity of having
multiple interpreters.

If you are futhered interested in this discussion I recommend subscribing
to the tcl mail list at [EMAIL PROTECTED]

Hope that helps :)

--
Mike

Reply via email to