Add instVar in Process

Michael Klein Mklein at nts.net
Wed Oct 6 19:09:33 UTC 1999


Rather than naming processes, I have a method

	Process >># initiatorBlock

than answers the block that got forked.
I find this is enough to identify most processes, even if they are
unnamed
(very usefull if you are debugging somebody else's code).

I ported from VW to Squeak easily (while composing this response),
mostly because both systems have 'thisContext'.
I am presently trying to port to VA, but the exposure of
the stack is causing all sorts of iritating problems.

You may find this easier and more usefull than adding a name to Process.
In Squeak 2.5,    

	(Process allInstances collect: [:p| p initiatorBlock ]) reject: [:each
| each isNil ]

		answers:
(
	[] in Delay class>>DoIt 
	[] in WeakArray class>>DoIt
	[] in InputSensor>>installInterruptWatcher 
	[] in ProcessorScheduler class>>startUp 
	[] in SystemDictionary>>installLowSpaceWatcher
	[] in ControlManager>>activeController:
)

The first to process come from the bad habit of releasing images with
processes
forked from a workspace or from changed code.  The Delay process should
be: 

	[] in Delay class>>startTimerInterruptWatcher

This can be remedied by doing a:

	Delay startTimerInterruptWatcher.

I'll figure out the WeakArray one later.

If anyone cares, I'll clean the code and send it on up.

-- Mike Klein

Squeak versus VisualAge  Hmmm,  tough call....  BlockClosures would tip
the scale for me.


On Wednesday, October 06, 1999 10:53 AM, David N. Smith (IBM)
[SMTP:dnsmith at watson.ibm.com] wrote:
> At 9:38 -0700 10/5/99, Xu Wang wrote:
> >I noticed Squeak dose not allow me to add extra instVars in Process. Is
> >there a special reason for it (e.g. hardcode in VM etc.)?
> >I need to add a process context which holds user defined process
> >dependent info.
> 
> I was looking at adding one yesterday, but backed off before I tried 
> it. In another Smalltalk that I use, processes can be named, and I 
> find it useful when a lot of processes are running around.
> 
> Dave
> _______________________________
> David N. Smith
> IBM T J Watson Research Center
> Hawthorne, NY
> _______________________________
> Any opinions or recommendations
> herein are those of the author
> and not of his employer.
> 





More information about the Squeak-dev mailing list