[squeak-dev] Refactoring #terminate to get rid of 'cannot return' errors etc.

Christoph Thiede christoph.thiede at student.hpi.uni-potsdam.de
Tue Mar 16 16:29:39 UTC 2021


Hi Jaromir,

I'm not an expert in this domain but maybe I can give my two cents anyway:

So first of all, you mentioned two motivations for your change:

1. Make terminated processes resumable
2. Clean up logic for testing termination

For 1: This is unorthodox thought because, in my view, a terminated process
has reached the end of its life cycle and does not need to be resumed again.
Can you give a concrete example where this would be useful to you? Why
wouldn't you create a new process instead in this situation? Why wouldn't
you just suspend the process? Why wouldn't you just manipulate its
suspendedContext manually? :-)

For 2: Cleaning up decades-old code is an honorable plan and might get
neglected too open in some areas. But if I understand you correctly, your
proposal would not directly allow us to remove the current #isTerminated
logic but only extend it, right? Because there could still be processes not
using the new #terminated marker and thus requiring us to keep the old
mechanisms. If this is correct, you basically propose to introduce an
alternative approach that needs to coexist with the existing one. I am not
sure whether this is really a desirable aim ... On the other hand,
#newProcess looks nicer now. Just some thoughts without a final judgment
(which I'm not qualified to pass anyway). :-)

And one small footnote:

> >>>> ctxt setSender: nil receiver: self method: (Process>>#terminated)
arguments: {}

I don't think we should consider these variables of a stack frame as mutable
fields. I'm not sure how the VM thinks about (see Eliot's description of
context marriage in [1]) and there might also be some entries in the local
stack of the context not being cleaned up. Wouldn't it be possible to
replace the context instance instead? See
Context>>#activateMethod:withArgs:receiver:class: or your own approach in
#newProcess.

Best,
Christoph

[1]
http://forum.world.st/Two-new-curious-Context-primitive-questions-tp5125779p5125783.html



-----
Carpe Squeak!
--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html


More information about the Squeak-dev mailing list