From: Stephen D. <sd...@gm...> - 2008-05-11 13:42:43
|
On Sat, May 10, 2008 at 2:27 PM, Vasiljevic Zoran <zv...@ar...> wrote: > > On 09.05.2008, at 20:44, Vasiljevic Zoran wrote: > >> What MIGHT work is kind of this: create some numbers of >> fully loaded interps, each sitting in its own thread. >> A compute-farm, so to say. Then every other thread just >> creates a slave interp in one of those and runs all its >> scripts in his private slave in one of those parked threads >> in the compute-farm, using some kind of message passing. >> The slaves have all the commands aliased into the main >> one. Not sure what would happen with uplevels and upvars >> here (need to think) but this is roughly what I'm >> contemplating about now. > > Upvars/Uplevels will not work. No way. > >> So when a thread exits, its >> thin-slave is just deleted completely. And created it is >> also fast. Just alias all commands from the master. Not >> sure about the global variables... this is still open. > > No access to variables... > So: no generic solution as I was looking after. > Undocumented: generic/tclResolve.c: Tcl_AddInterpResolvers() You could probably even fake-up a solution using a single interp with your own name resolvers. Before you start executing the code for a single client, set a 'context' global which your resolver routines will use to keep state variables separate for each client. |