[Cuis-dev] Follow-up: #terminate and #suspend update

Jaromir Matas mail at jaromir.net
Fri Feb 24 13:22:28 PST 2023


Hi Juan,

> Not sure why you removed the `push: nil` in #unwindAndStop:

I haven't; #unwindAndStop: was not part of the latest changeset, the previous version probably sneaked back in somehow :) The correct version is included in the attached changeset.

The attached is mostly polishing up, but also a few small bugfixes:

#contextOn:do: ... the same bug as in #contextEnsure:
#unwindTo:safely: ... a missing nil check (dealing with: [] ensure: nil); a corresponding test included
#runUntilErrorOrReturnFrom: ... a missing nil check (discovered in a Squeak example but relevant for Cuis too)

Maybe we could remove the methods associated with my initial #terminate attempt you renamed to #terminateFromForkedProcess. But it's up to you if you want to keep them for a little longer. It'd be:
#terminateFromForkedProcess
#complete:to:
#runUnwindUntilErrorOrReturnFrom:

This would be the final update in the "termination department" :)

Many thanks for your always inspiring comment and suggestions!

Best,
Jaromir


--

Jaromír Matas

mail at jaromir.net


From: Juan Vuletich<mailto:juan at cuis.st>
Sent: Friday, February 24, 2023 11:49
To: Discussion of Cuis Smalltalk<mailto:cuis-dev at lists.cuis.st>
Cc: Jaromir Matas<mailto:mail at jaromir.net>
Subject: Re: [Cuis-dev] Follow-up: #terminate and #suspend update

Hi Jaromir,

Thank you for your continued help with this tricky area of the system!

I've just integrated your changes. Just a couple of comments:
- Any update to comments is of course welcome. Thanks!
- Not sure why you removed the `push: nil` in #unwindAndStop:, but I trust you know what you are doing here.

Cheers,

On 2/7/2023 5:49 PM, Jaromir Matas via Cuis-dev wrote:
Hi Juan,

I’m enclosing a version (002) further improving the previous changeset (001), for your review/merge with the following changes:

1) placed "suspendedContext _ nil" assignment as close to the #suspend message as possible

2) improved readability (I hope)

If you’re ok with it I’ll refine outdated comments. It passes all Process and Exception tests in both Cuis and Squeak.

Thanks for your time and any comments.

Best,


--

Jaromír Matas

mail at jaromir.net<mailto:mail at jaromir.net>


From: Juan Vuletich<mailto:juan at cuis.st>
Sent: Monday, January 30, 2023 20:57
To: Discussion of Cuis Smalltalk<mailto:cuis-dev at lists.cuis.st>
Cc: Jaromir Matas<mailto:mail at jaromir.net>
Subject: Re: [Cuis-dev] Follow-up: #terminate and #suspend update

Hi Jaromir,

Thank you very much for this.

Unfortunately, I'll be out of town for a few days, and I think it could be a bit risky if I push these changes, and then I'm not available to help address any issues that could occur.

I promise I'll review and integrate your contributions as usual, when back in town. Thanks for your patience.

Cheers,

On 1/30/2023 10:20 AM, Jaromir Matas via Cuis-dev wrote:
Hi Juan,

I’m enclosing a modified #terminate that would fix the two failing tests, plus some more Semaphore tests further exploring the semantics during unwinds, and a fix of a small bug in #unwindAndStop:. All tested and green even in in Squeak :)

Best,
Jaromir


--

Jaromír Matas

mail at jaromir.net<mailto:mail at jaromir.net>


From: Juan Vuletich<mailto:juan at cuis.st>
Sent: Tuesday, January 24, 2023 19:49
To: Discussion of Cuis Smalltalk<mailto:cuis-dev at lists.cuis.st>
Cc: Jaromir Matas<mailto:mail at jaromir.net>
Subject: Re: [Cuis-dev] Follow-up: #terminate and #suspend update

Hi Jaromir,

Just pushed these to github, together with #expectedFailures.

Thanks!

On 1/23/2023 4:30 PM, Jaromir Matas via Cuis-dev wrote:
Hi Juan,

Thanks again. I’m enclosing the two tests I’d like to store for future reference.

They both illustrate system’s behavior when you attempt to resume or terminate a process that is being terminated and the termination procedure is in a vulnerable early stage: specifically when the terminating suspended context/stack is being prepared, before running the “proper” unwind. In this particular situation the termination may derail. The probability of such an event is reasonably low but why not fix it. A possible solution is commented in the tests but before integrating it I want to test it thoroughly in Squeak/Pharo as well. The idea is to nil the suspended context during the preparation of the new stack to prevent accidental resumption/termination. Once the “proper” unwind starts it’s ok to terminate the terminating process again as demonstrated in # testTerminateTerminatingProcessAfterUnwindStarted

Best,
Jaromir

--

Jaromír Matas

mail at jaromir.net<mailto:mail at jaromir.net>


From: Juan Vuletich via Cuis-dev<mailto:cuis-dev at lists.cuis.st>
Sent: Monday, January 23, 2023 15:25
To: Discussion of Cuis Smalltalk<mailto:cuis-dev at lists.cuis.st>
Cc: Juan Vuletich<mailto:juan at cuis.st>; Jaromir Matas<mailto:mail at jaromir.net>
Subject: Re: [Cuis-dev] Follow-up: #terminate and #suspend update

Hi!

On 1/22/2023 4:29 PM, Jaromir Matas via Cuis-dev wrote:
Hi again,

Missed the list, sorry.

As we agree to keep the current isTerminated semantics (also consistent with Squeak/Pharo) I’d suggest to use the test as the documentation of the observed behavior; I’ve added a link to the archive in the comment.

Just pushed it to github.










Question: is there a way to make a test an “expected failure” like in Squeak? In Squeak I create a method

ProcessTest>>#expectedFailures

                ^ #(testTerminateTerminatingProcess testResumeTerminatingProcess)

As a result the two listed tests show green in the test runner if they fail.

If possible, I’d like to post two tests that currently fail as a reminder/documentation.

Plase post those tests. If nobody beats to me, I'll add expected failure functionality.





Thanks,
Jaromir

Thanks,





--

Juan Vuletich

cuis.st

github.com/jvuletich

researchgate.net/profile/Juan-Vuletich

independent.academia.edu/JuanVuletich

patents.justia.com/inventor/juan-manuel-vuletich

linkedin.com/in/juan-vuletich-75611b3

twitter.com/JuanVuletich







--

Juan Vuletich

cuis.st

github.com/jvuletich

researchgate.net/profile/Juan-Vuletich

independent.academia.edu/JuanVuletich

patents.justia.com/inventor/juan-manuel-vuletich

linkedin.com/in/juan-vuletich-75611b3

twitter.com/JuanVuletich






--

Juan Vuletich

cuis.st

github.com/jvuletich

researchgate.net/profile/Juan-Vuletich

independent.academia.edu/JuanVuletich

patents.justia.com/inventor/juan-manuel-vuletich

linkedin.com/in/juan-vuletich-75611b3

twitter.com/JuanVuletich





--

Juan Vuletich

cuis.st

github.com/jvuletich

researchgate.net/profile/Juan-Vuletich

independent.academia.edu/JuanVuletich

patents.justia.com/inventor/juan-manuel-vuletich

linkedin.com/in/juan-vuletich-75611b3

twitter.com/JuanVuletich

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230224/9c4e52e6/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BaseImageTests-jar.001.cs.st
Type: application/octet-stream
Size: 580 bytes
Desc: BaseImageTests-jar.001.cs.st
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230224/9c4e52e6/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 5668-CuisCore-JaromirMatas-jar.001.cs.st
Type: application/octet-stream
Size: 8354 bytes
Desc: 5668-CuisCore-JaromirMatas-jar.001.cs.st
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230224/9c4e52e6/attachment-0003.obj>


More information about the Cuis-dev mailing list