Process local variable and debugging

Tim Rowledge tim at sumeru.stanford.edu
Thu Feb 7 00:35:33 UTC 2002


Here's an intersting little problem.

I'm trying to build a swiki.net application and having a lot of problem
when debugging. The problem is a side effect of how swiki.net keeps
track of the http request and other stuff for each process that it
spawns. The intention is to use 'globals' attached to each process
(I'll let Stephen explain if he wants to) - which works reasonably well
although it always makes me a bit nervous to mess with the structure of
Processes.

The problem comes when debugging. The code to set or get the pseudo
globals involves incantations like
	Processor activeProcess foobleAt: wibble
and when debugging the Processor activeProces is.... the debugger
process. Bang, end of debugging run :-(

There are three possible solutions I can see.
a) fix the debugger to work around this. It seems like it might be a
good idea to get the process being debugged when your code says
Processor activeProcess, but on the other hand it might be confusing in
some cases. This might be a situation where an integrated environmentis
a bit of a liability.
b) make a way to have 'thread local variables' that doesn't raise the
problem. Namespaces of some sort?
c) some other way of provding the same functionality in a different
manner entirely. ComSwiki does this by explcitly passing the
httprequest(etc) to all code involved.

Helpful suggestions welcomed.

tim
-- 
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Fractured Idiom:- IDIOS AMIGOS - We're wild and crazy guys!




More information about the Squeak-dev mailing list