Process>>terminate woes

Igor Stasenko siguctua at gmail.com
Tue Dec 4 23:58:02 UTC 2007


On 05/12/2007, Andreas Raab <andreas.raab at gmx.de> wrote:
> Andreas Raab wrote:
> > I wouldn't call what I'm proposing a "dirty hack" - it's rather what I
> > think primitiveSuspend really *ought* to do. The primitive is (and
> > always was in my understanding) incomplete in this respect.
>

Maybe, again i was not precise with what i saying :), i just only
meant that without changes to VM, its very difficult to create a good
non-buggy implementation of Process without concurrency issues
mentioned above.
That's why, the key moments, which should performed atomically, should
be implemented by VM to prevent any possibilities to step into
problems in future.

But still, a simple modification, like managing myList by VM means,
that VM "knows" the structure of process, which means that we tightly
bound the processes state with VM, and this is what i don't like.
Because we making it rigid and will be not able to change in future.
Its obvious, that to avoid such dependency, we should rethink the
structure(s) to not force VM "knowing" the Process layout.

> BTW, to emphasize this aspect have a look at the senders of
> #suspendingList. For example, ControlManager>>interruptName: does this
>
> (suspendingList := activeControllerProcess suspendingList) == nil
>    ifTrue: [activeControllerProcess == Processor activeProcess
>               ifTrue: [activeControllerProcess suspend]]
>    ifFalse: [suspendingList remove: activeControllerProcess ifAbsent:[].
>              activeControllerProcess offList].
>
> With the proposed change to #primitiveSuspend this becomes merely:
>
>    activeControllerProcess suspend.
>
> (which is obviously the intended and correct way of doing things). Other
> places that get cleaned up with the modification include for example
> Process>>suspend (which becomes merely a call to #primitiveSuspend) and
> Project class>>interruptName: (and probably some others).
>
> Cheers,
>    -Andreas
>
>


-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list