[Pharo-project] Process-specific state broken and uncomplete

Igor Stasenko siguctua at gmail.com
Mon Nov 8 06:39:05 CET 2010


i just found that Squeak images Process class contains unused ivars:
island env

in Pharo image, env ivar is used for holding a process-specific state,
which is convenient, so one could use:
Processor activeProcess environmentAt: put:...

but in Squeak image there is even no such methods.

There are also some caveats with such thing:
during process termination, Processor activeProcess could point to
different process,
and so, accessing to process environment may lead to error(s).

To avoid issues like these, the process termination action (stack
unwinding) should be always performed only for active process.
One of a trick i think, is to replace the suspendedContext with own
context, and then activate given process in order to unwind its stack

Another way is to remember environment somewhere else during process
termination, and use different method to access it i.e. instead of:
Processor activeProcess environmentAt:
self processEnvironmentAt:

where #processEnvironmentAt: is implemented in Object class, and can
handle termination gracefully.

But i think replacing suspendedContext is more generic.
What you think?

Best regards,
Igor Stasenko AKA sig.

More information about the Pharo-project mailing list