<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Andreas,<br>
Many thanks for helping me along. Your advice to use stepping was
sound, but didn't quite fit my needs. I tried several alternative
solutions with running my visualization in a separate process, but they
all failed. <br>
<br>
This led to an important (in retrospect: obvious) discovery:<br>
<br>
I CANNOT CHANGE THE DISPLAYED MORPHS IN A SEPARATE PROCESS.<br>
Reason: Adding, removing, or changing a submorph lead to a call on
Morph&gt;&gt;layoutChanged which sets fullBounds := nil recursively up
the owner chain.<br>
<br>
At the same time, the normal process is happily repeating
WorldState&gt;&gt;doOneCycleFor: aWorld. This includes redisplaying the
World, computing fullBounds if needed.<br>
<br>
The separate process can have set fullBounds to nil at any
point in the redisplay loop. Usually, this has no bad effect,
but MNU or primitiveError can happen in rare cases. (I run my animation
overnight to make this happen.) Hence the above conclusion. Two
unsynchronized processes should not share a common variable. The basic
process and my process did share the whole morphic display hierarchy.<br>
<br>
No apologies for stating the obvious<br>
--Trygve<br>
<br>
<br>
<br>
On 06.05.2009 18:09, Andreas Raab wrote:
<blockquote cite="mid:4A01B61C.7080104@gmx.de" type="cite">Trygve
Reenskaug wrote:
  <br>
  <blockquote type="cite">I have a visualization demo. It runs in a
separate process to permit mouse and keyboard input while it runs:
    <br>
&nbsp;&nbsp;&nbsp; startChaosAnimation
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; currentState = #CHAOS ifTrue: [^self].
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; currentState := #CHAOS.
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; processSemaphore wait.
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BB2ChaosCtx startChaosAnimationOn: data.
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; processSemaphore signal.
    <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ] fork.
    <br>
    <br>
BB2ChaosCtx startChaosAnimationOn: data starts a loop that creates and
removes Morphs interspersed with suitable Delays to get the speed
right.
    <br>
    <br>
The process can run for several hours before crashing in various ways.
It sometimes crashes with a primitiveError while redisplaying World. A
simpler stop was an MNU in
    <br>
&nbsp;&nbsp;&nbsp; MorphicEventDispatcher&gt;&gt;dispatchDefault: anEvent with: aMorph
    <br>
where aMorph =&nbsp; a PasteUpMorph [world], with fullBounds = nil
    <br>
    <br>
My process is clearly in some unfortunate state when the main process
repaints or handles the mouse. Any ideas how I should make my process
safe?
    <br>
  </blockquote>
  <br>
Use Morph stepping instead of an unsynchronized process.
  <br>
  <br>
Cheers,
  <br>
&nbsp; - Andreas
  <br>
  <br>
  <br>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<meta http-equiv="Content-Type" content="text/html; ">
<meta name="ProgId" content="Word.Document">
<meta name="Generator" content="Microsoft Word 10">
<meta name="Originator" content="Microsoft Word 10">
<link rel="File-List" href="TrygveSignature-filer/filelist.xml">
<title>-- </title>
<!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:SpellingState>Clean</w:SpellingState>
  <w:GrammarState>Clean</w:GrammarState>
  <w:HyphenationZone>21</w:HyphenationZone>
  <w:PunctuationKerning/>
  <w:DrawingGridHorizontalSpacing>6 pt</w:DrawingGridHorizontalSpacing>
  <w:DrawingGridVerticalSpacing>6 pt</w:DrawingGridVerticalSpacing>
  <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
  <w:DisplayVerticalDrawingGridEvery>3</w:DisplayVerticalDrawingGridEvery>
  <w:UseMarginsForDrawingGridOrigin/>
  <w:DoNotShadeFormData/>
  <w:Compatibility>
   <w:FootnoteLayoutLikeWW8/>
   <w:ShapeLayoutLikeWW8/>
   <w:AlignTablesRowByRow/>
   <w:ForgetLastTabAlignment/>
   <w:LayoutRawTableWidth/>
   <w:LayoutTableRowsApart/>
   <w:UseWord97LineBreakingRules/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]-->
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-parent:"";
        margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:12.0pt;
        font-family:"Times New Roman";
        mso-fareast-font-family:"Times New Roman";}
span.SpellE
        {mso-style-name:"";
        mso-spl-e:yes;}
span.GramE
        {mso-style-name:"";
        mso-gram-e:yes;}
 /* Page Definitions */
 @page
        {mso-page-border-surround-header:no;
        mso-page-border-surround-footer:no;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;
        mso-header-margin:35.4pt;
        mso-footer-margin:35.4pt;
        mso-paper-source:0;}
div.Section1
        {page:Section1;}
-->
</style><!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
        {mso-style-name:"Vanlig tabell";
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
        mso-para-margin:0cm;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";}
</style>
<![endif]--><!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="2050"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1"/>
 </o:shapelayout></xml><![endif]-->
<div class="Section1">
<p class="MsoNormal" style=""><span class="SpellE"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB">Trygve</span></span><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB">
Reenskaug<span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>mailto: <span class="SpellE"><a class="moz-txt-link-abbreviated" href="mailto:trygver@ifi.uio.no">trygver@ifi.uio.no</a></span></span><span
 style="font-size: 10pt; font-family: Arial;"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span class="SpellE"><span class="GramE"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB">Morgedalsvn</span></span></span><span
 class="GramE"><span style="font-size: 10pt; font-family: Arial;"
 lang="EN-GB">.</span></span><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB"> 5A <span
 style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><a class="moz-txt-link-freetext" href="http://heim.ifi.uio.no/~trygver">http://heim.ifi.uio.no/~trygver</a><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: Arial;">N-0378
Oslo<span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Tel: (+47) 22 49 57 27<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span class="SpellE"><span
 style="font-size: 10pt; font-family: Arial;">Norway</span></span><span
 style="font-size: 10pt; font-family: Arial;"><o:p></o:p></span></p>
</div>
</div>
</body>
</html>