[squeak-dev] Re: Process conflict when redisplaying World

Trygve Reenskaug trygver at ifi.uio.no
Wed May 6 16:38:59 UTC 2009


Thanks Andreas, for your very quick answer.
Stepping was the first mechanism I tried, but the program got very 
complex keeping track of what to do at each step. My goal is to have a 
simple, readable program and the stepping alternative was neither simple 
nor readable.  So I'm trying other solutions.

Cheers
--Trygve

On 06.05.2009 18:09, Andreas Raab wrote:
> Trygve Reenskaug wrote:
>> I have a visualization demo. It runs in a separate process to permit 
>> mouse and keyboard input while it runs:
>>     startChaosAnimation
>>         currentState = #CHAOS ifTrue: [^self].
>>         currentState := #CHAOS.
>>         processSemaphore wait.
>>             BB2ChaosCtx startChaosAnimationOn: data.
>>             processSemaphore signal.
>>         ] fork.
>>
>> BB2ChaosCtx startChaosAnimationOn: data starts a loop that creates 
>> and removes Morphs interspersed with suitable Delays to get the speed 
>> right.
>>
>> 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
>>     MorphicEventDispatcher>>dispatchDefault: anEvent with: aMorph
>> where aMorph =  a PasteUpMorph [world], with fullBounds = nil
>>
>> 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?
>
> Use Morph stepping instead of an unsynchronized process.
>
> Cheers,
>   - Andreas
>
>

-- 

Trygve Reenskaug       mailto: trygver at ifi.uio.no

Morgedalsvn. 5A         http://heim.ifi.uio.no/~trygver

N-0378 Oslo               Tel: (+47) 22 49 57 27

Norway

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20090506/aad8bdcc/attachment.htm


More information about the Squeak-dev mailing list