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: Tue, 25 Mar 2014 15:00:57 +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/Process.st: Change the process creation it set on the right 
priority queue,
+       the previous implementation sets it on a wrong priority queue.
+       * kernel/MthContext.st: Add a new MethodContext builder.
+       * kernel/SysExcept.st: 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?


+
      debugger [
        "Return the object in charge of debugging the receiver.  This always 
returns
         nil unless the DebugTools package is loaded."
@@ -367,46 +377,17 @@ can suspend themselves and resume themselves however they 
wish.'>
      ]
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?

Hope it's better

Attachment: 0006-kernel-Change-process-creation.patch
Description: Text Data


reply via email to

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