On Sat, May 10, 2008 at 05:50:42PM +0200, Vasiljevic Zoran wrote:

> Since some years I've been trying various approaches how to tackle
> this problem but I really found no realy good and universal way.
> I believe there isn't one, after all those years. I will try just this

No, I believe that there certainly must be a good solution to your
sort of problem.  Whether there's any nice incremental solution in
your case is much less clear!  E.g., "Rewrite your entire app in
Erlang." is probably not a useful solution for you, and would have its
own very substantial risks and uncertainties.

I certainly encourage you to continue picking the brains of the folks
who have serious deep knowledge of the Tcl interpretor's design and
implementation.  (E.g., I certainly don't understand WHY the Tcl
compiled bytecode is somehow magically linked to and usable only by
the interp that created it.  Why can't you have a single memory region
with bytecode used by all 1000 independent interps?)

> one more idea with unknown-overloading and dispatching unknown command
> to a battery of preloaded interps living in different threads. Although

Yes, avoiding having an entire heavyweight Tcl thread + interp for
each one of your thousands of client connections is probably the way
to go in your case.  You're going for some sort of threadpool design
instead.  But, it IS rather ugly that memory usage from 1000 redundant
copies of identical code FORCES you down that road.

> Hopefully I will soon find piece of mind with this issue and stop
> going on other people's nervers and saturate email lists :-)

Not at all, I think you are tackling an inherently interesting
problem, which if solved well, would definitely be useful to others
too.

I think the main reason YOU are stuck tackling this, is that there
simply aren't all that many people who REALLY want or need your
'thousands of lightweight processes' use case.  And of that set of
people, you might be the only one who happens to be doing it with Tcl
(and Naviserver), rather than one of the other dozens (or hundreds?)
of plausible programming languages and toolkits.

-- 
Andrew Piskorski <[EMAIL PROTECTED]>
http://www.piskorski.com/

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to