help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] [PATCH] Process creation


From: Gwenaël Casaccio
Subject: Re: [Help-smalltalk] [PATCH] Process creation
Date: Fri, 11 Apr 2014 11:10:35 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 25/03/2014 17:33, Paolo Bonzini wrote:
Il 25/03/2014 15:00, Gwenaël Casaccio ha scritto:
+        <category: 'private'>
+
+        Termination isNil ifFalse: [ ^ Termination ].
+        ^ [
+            Termination isNil ifTrue: [ Termination := MethodContext
+ stack: 4
+ flags: 6
+ method: UndefinedObject>>#__terminate
+ ip: 0
+ sp: -1 ].
+            Termination
+          ] valueWithoutPreemption
+    ]

Can you explain this better?  What does it have to do with #ensure:?

Also, can you just use ##( ... ) and avoid #valueWithoutPreemption?

Paolo

I've rewritten the patch, termination is initialized in ProcessScheduler.
I need termination otherwhise the test is not working:

"Now test process interrupts"
Eval [
    s := Semaphore new.
    ([ [ false ] whileFalse: [ Processor yield ] ]
        forkAt: Processor userBackgroundPriority)
        name: 'background';
queueInterrupt: [ (p := Processor activeProcess) printNl. s signal ].

    s wait.
    p printNl.
    p ensureTermination.
    p printNl
]

Gwen

Attachment: 0001-Change-the-process-creation.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]