[squeak-dev] Re: n-core Smalltalk at work [Re: Hydra now can do mitosis]

Igor Stasenko siguctua at gmail.com
Mon Feb 23 03:12:08 UTC 2009


2009/2/22 Rob Rothwell <r.j.rothwell at gmail.com>:
> On Sun, Feb 22, 2009 at 1:38 PM, Klaus D. Witzel <klaus.witzel at cobss.com>
> wrote:
>>
>> Yes, "classic" Hydra loads the second .image from file and mitosis Hydra
>> populates (the second) an empty .image from am arrayOfObjects passed in.
>
> Ok...this is just, well, fun, but I can't quite figure out how to get a
> second image loaded with the #doIt channel "working."  I figure it's because
> I don't have the image I created it from set up right?  All I did was go
> down the line of in the Helpful doits workspace:
>
> "Sanity check, are we running HydraVM?"
> HydraVM isHydra  [true]
>
> "To prepare an image for running in background thread (careful, VM will quit
> if you run this)"
> HydraVM saveAsHeadlessImage: 'test.image'  [current image shut down and
> created another image]
>
> "To run previously prepared image"
> HydraVM loadAndRunNewImage: 'test.image'  [seemed to work]
>
> "How many interpreters VM currently running"
> HydraVM interpreterInstanceCount [2...this is good!]
>
> "Test to check if main image listening for #transcript channel ..."
> HydraChannel send: 'Transcript test' to: (HydraInterpreter current) channel:
> #transcript [true after the following line]
>
> "... if not, try doing this first: "
> HydraTranscript install
>
> "Simple test to check if second image listens #doIt channel "
> HydraChannel hasChannel: #doIt at: (HydraInterpreter at: 2)  [false]
>
> Drat!!!
>

Yep.. in 3.10 this not working..
It looks like there are some crap in image startup method.
As a workaround, you can register the #doIt channel in your base image:

HydraVM registerDoItChannel.
and only then do
HydraVM saveAsHeadlessImage: 'test.image'

should work ok.

> " ... and has Transcript global var replaced to redirect all input to main
> image"
> (HydraInterpreter at: 2) doIt: 'Transcript show: ''Doit Test'''
>
> "Do you like to install something to secondary image?"
> (HydraInterpreter at: 2) doIt: '(HTTPSocket httpGet:
> ''installer.pbwiki.com/f/Installer.st'') fileIn '
>
> "Do you like to save it? "
> (HydraInterpreter at: 2) doIt: 'Smalltalk snapshot: true andQuit: false '
>
>
> Take care,
>
> Rob
>
>
>
>
>



-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list