[squeak-dev] Re: Process-specific state broken and uncomplete
Igor Stasenko
siguctua at gmail.com
Tue Nov 9 20:20:31 UTC 2010
On 9 November 2010 19:07, Andreas Raab <andreas.raab at gmx.de> wrote:
> On 11/8/2010 7:39 PM, Igor Stasenko wrote:
>>
>> Suppose you have a domain object which provides following ways to
>> access the session:
>>
>> session: forkedSession
>> Processor activeProcess environmentAt: #session put: forkedSession
>>
>> session
>> ^ Processor activeProcess environmentAt: #session
>>
>>
>> now, here what i'd like to write:
>>
>> | session |
>>
>> session := MySession new .
>> session initialize blabla.
>>
>> "good fork"
>> good := [
>> self session: session.
>> [ self process stuff ] ensure: [ session close ]
>> ] newProcess.
>>
>> good resume.
>> 1 minute asDelay wait.
>> good terminate.
>> self assert: (session isClosed).
>
> You'll be happy to hear that Eliot's fixes address this very problem. I just
> wrote a simple test to illustrate the issue more clearly:
>
> ProcessTest>>testFaithfulTerminate
> "Ensure that we have process-faithful termination and unwind"
>
> | p |
> p := [
> [Semaphore new wait] ensure:[self assert: Processor
> activeProcess == p].
> ] forkAt: Processor activePriority + 1.
> p terminate.
>
> This test passes fine in our images that have the process-faithful debugging
> fixes.
>
Yeah, that's great.
During unwinding, code should be run in same environment where it
expected to run, otherwise
problems is unavoidable.
> Cheers,
> - Andreas
>
--
Best regards,
Igor Stasenko AKA sig.
More information about the Squeak-dev
mailing list
|