[Top][All Lists]

[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: Tue, 25 Mar 2014 14:13:02 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

On 25/03/2014 14:03, Holger Hans Peter Freyther wrote:
On Tue, Mar 25, 2014 at 11:33:24AM +0100, Gwenaël Casaccio wrote:

Subject: [PATCH 6/6] Fix Process creation the priority is correctly set, if
  the new process is suspended the current process is not yielded. Some
Please have a look at man git-commit and make your commit messages follow
it. I really don't fancy to re-write your commit messages all the time.

+2014-03-25  Gwenael Casaccio  <address@hidden>
+       * kernel/ Change the process creation it set on the right 
priority queue,
+       the previous implementation sets it on a wrong priority queue.
+       * kernel/ Add a new MethodContext builder.
+       * kernel/ ProcessBeingTerminated>>defaultHandler will 
execute all the ensure blocks.
Please honor the width of 80 and wrap in a more sensible way.

+    Process class >> termination [
+        <category: 'private'>
+        Termination isNil ifFalse: [ ^ Termination ].
+        ^ [
+            Termination isNil ifTrue: [ Termination := MethodContext stack: 4 flags: 
6 method: UndefinedObject>>#__terminate ip: 0 sp: -1 ].
+            Termination
+          ] valueWithoutPreemption
+    ]
Same comment as before? Why so complciated instead of the simple
form I proposed?
It's not complicated Holger, I want to be sure to have one instance of it.

      debugger [
        "Return the object in charge of debugging the receiver.  This always 
         nil unless the DebugTools package is loaded."
@@ -367,46 +377,17 @@ can suspend themselves and resume themselves however they 
onBlock: aBlockClosure at: aPriority suspend: aBoolean [
+        <category: 'private'>
+        | closure |
+        closure := [ [ aBlockClosure value ] ensure: [ self primTerminate ] ].
+       " With the context created by  terminate  the 'ensure' blocks not
+         evaluated. "
+        suspendedContext := closure asContext: (self class termination) copy.
+        priority := aPriority.
+        self addToBeFinalized.
+        aBoolean ifTrue: [ ^ self ].
+        self resume
Rename "aBoolean" to something reasonable. Your comment is badly formatted
and is missing some words. How is the "Processor yield" thing handled? It is
not needed anymore as you fixed the invairant?

Processor yield is done by self resume if priority is smaller than the active
process the new process won't be the active one.

reply via email to

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