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: Holger Hans Peter Freyther
Subject: Re: [Help-smalltalk] [PATCH] Process creation
Date: Tue, 25 Mar 2014 14:03:59 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

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?



reply via email to

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