Am 26.05.2005 um 11:47 schrieb Andrew Piskorski:

On Thu, May 26, 2005 at 10:59:16AM +0200, Zoran Vasiljevic wrote:


Also, although all in Tcl_CloneInterp is done in C, I'm afraid
that it could still take considerable time to copy 1000 or so
commands


But Jeff H. said it has already been done single-threaded on that Tcl
8.3.x branch for Cisco, and that it was very fast!  So, are you saying
that multi-threaded Tcl needs something done DIFFERENTLY, and that you
suspect/fear that those differences would introduce a large slowdown?
Or what?


First, I doubt that the process will be fast enough when applied to
tons of loaded procedures, namespaces, variables and all of those things
you would need to copy from an AS initialized interpreter. Remember,
this has to be done on each new page-request! This will chew-up pretty
much of your CPU, regardless if you do it in C or not.

Second, I doubt that this approach (interp-cloning) will be feasible
generally since not all things *are* actually in the interp alone. Some
packages need to be loaded per-thread specifically since they (must)
maintain some thread-specific state. Hence, it is not sufficient just
to clone the interp alone. You must also "clone" that (package specific
and non-interp) data. How would you do that in a generic way?
AFAIK, there is no other way to achieve this but re-loading the package
on per-thread basis. But then, why would one need cloning of the interp?

The more I think of this, the less I'm convinced that anything will work
satisfactorily. One small light at the end of the tunnel would be the
slave-interp approach as I described in my previous mail. One still have
to checkout what would it mean (speedwise) to wholesale alias the entire
AS interp in a slave. Also, one would need to revise the application
logic
to cope with globally accessible data (data from the master interp).
All in all, this would require changes in both server (not that much)
and application logic (pretty much) but could be a way one might go
if the "cleaness" of the interp between requests is of the utmost
importance.

Zoran


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to