Process'ing

Tim Olson tim at jumpnet.com
Tue Feb 1 22:59:56 UTC 2000


John Clonts wrote:

>I'm expecting the following code to print on the Transcript until i
>change the inspected Valueholder to hold false.  But nothing at all
>shows on the transcript.
>
>| f |
>f := ValueHolder new contents: true. f inspect.
>[ [ f contents ] whileTrue: 
>        [ Transcript show: 'working' ;cr ] ]
>        forkAt: Processor userBackgroundPriority.
>
>
>Can someone explain, or give a snippet that "works"? ( The equivalent
>does in VW)
>
>This doesn't have something to do with the discussion about
>BlockContexts' temporaries "real vs squeak" I hope?

I saw your query in comp.lang.smalltalk before I saw this, so I responded 
there.  Here's a recap, for those non usenet readers:

----
This code works fine if run in the Morphic environment -- I assume
you are trying to run it in the MVC environment.  The problem there
is that performing the "f inspect" causes an inspector to open, which
terminates the current thread of control in the MVC environment (i.e.
everything after the "f inspect" in the thread of control is never
executed).

To see this in gory detail, opening the inspector causes the
following method to run:

Inspector >> openOn: anObject withEvalPane: withEval withLabel: label
valueViewClass: valueViewClass

which ends with

   topView controller open

where topView is a StandardSystemView.

This causes the controller (a StandardSystemController) to run:

open
   "Create an area on the screen in which the receiver's scheduled
view can 
   be displayed. Make it the active view."

   view resizeInitially.
   status _ #open.
   ScheduledControllers scheduleActive: self

This causes the ControlManager to run:

scheduleActive: aController 
   "Make aController be scheduled as the active controller.
Presumably the 
   active scheduling process asked to schedule this controller and
that a 
   new process associated this controller takes control. So this is
the last act 
   of the active scheduling process."
   <primitive: 19> "Simulation guard"
   self scheduleActiveNoTerminate: aController.
   Processor terminateActive


Try running your code in the Morphic environment (do Open... Morphic
Project from the root menu and enter the project).
----

     -- tim






More information about the Squeak-dev mailing list