Bernd Eidenschink wrote:
Well, the line above, if uncommented, creates a (big) file which holds all
procs sourced in after startup.
Is it a bad idea, maybe before use on the production system, to let AOLserver
create the file, byte compile the procs, adding "load libtbcload..." and
sourcing this file instead of running through the process every time?
No, it's not a bad idea.

What do you mean?  What exactly are you trying to achieve?
Would that help speed up things?
About 10% in thread initialization, yes - this is what I got after using
tbcload in initialization of my custom modules. The main idea, however,
was to hide the Tcl code used in AOLserver, since it was designed so
that it would run on other servers...

This won't, however, be noticable under normal or heavy load, since
threads are initialized as rarely as possible, and procs are
bytecompiled internally during their first execution (or even when
calling the 'proc' command - don't remember :).

Would it "hide" all procs from the info vars/procs/body... command to make it
(more) difficult to inspect vars, procs and environment at runtime?
You can inspect vars, procs and environment if you have the 'info'
command. You could, however, rewrite info not to report some things.

It is a bad idea, however, to do so. If you want to host AOLserver based
webpages, then you could consider this solution:

1/ write custom ADP parser that (or use nsdqe which calls Tcl command to
parse ADPs - www.zoro2.org/dqe-1.0.tar.gz) will switch <% some stuff %>
to 'slaveeval {some stuff}' or <%=$a%> to slaveeval {ns_puts -nonewline $a}.

2/ write slaveeval to determine which slave interpreter to use (I would
use [ns_url2file /] :), then if it's not in this thread, create it.

3/ thread creation is a very hard thing to do - you could set up some
security policies - ie which interpreters can use db pools, write/read
files and so on.

You could consider using interp create -safe and then write your own
open/file/info and so on to provide things. This would get a *lot*
easier with Tcl 8.4 and it's file nativename...

--
WK
(written at Stardate 56912.4)

"Data typing is an illusion. Everything is a sequence of bytes."
                                                             -Todd Coram

Reply via email to