issue-#156 adding Coroutines to BlackBox

Merged to the master branch

Re: issue-#156 adding Coroutines to BlackBox

Postby Robert » Tue Apr 16, 2019 6:36 pm

Josef Templ wrote:And it only happens when you unload the suspended coroutine's module, right?

My normal workflow is:
- Edit
- Ctrl k - Compile
- Ctrl s - Save if no compile errors.
- Unload
- Try new version
& repeat many times ....

The crashes usually occur during the Compile.
User avatar
Robert
 
Posts: 968
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#156 adding Coroutines to BlackBox

Postby Robert » Tue Apr 16, 2019 6:37 pm

Josef Templ wrote:What about stopping the coroutine(s) before unloading the module?

Not exactly sure what you are suggesting - I think you mean adding something to the CLOSE section of my module?
User avatar
Robert
 
Posts: 968
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#156 adding Coroutines to BlackBox

Postby Josef Templ » Tue Apr 16, 2019 6:38 pm

What you could also try is to unload all modules that use Coroutines and in addition to unload the module Coroutines themselves.
This terminates Coroutine support and may lead to a more stable behavior with respect to GC.

- Josef
User avatar
Josef Templ
 
Posts: 1957
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#156 adding Coroutines to BlackBox

Postby Robert » Thu Apr 18, 2019 11:54 am

In the last couple of days the main activity of my Coroutines module has changed from being 90% development / 10% use to 10% development / 90% use. I am getting far fewer crashes - 1 two days ago.

I have now added Coroutines.Cleanup to my CLOSE section. I don't really understand what it does. The Docu says "sets main.from = NIL". Is that correct?
User avatar
Robert
 
Posts: 968
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#156 adding Coroutines to BlackBox

Postby Robert » Thu Apr 18, 2019 1:55 pm

And now I got another (small window) TRAP: "illegal memory write [ad = 0000008]" called from Coroutines.Cleanup.
User avatar
Robert
 
Posts: 968
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#156 adding Coroutines to BlackBox

Postby Josef Templ » Thu Apr 18, 2019 8:04 pm

Robert wrote:And now I got another (small window) TRAP: "illegal memory write [ad = 0000008]" called from Coroutines.Cleanup.


This one can be explained, I think.
Coroutines.Cleanup assumes that coroutines have been started and then main is not NIL. IF main is NIL you get what you have observed.
The fix in Coroutines.Cleanup is simple. It can also be done from the outside, of course.

Code: Select all
   PROCEDURE Cleanup*;
   BEGIN
      IF main # NIL THEN main.source := NIL END
   END Cleanup;


- Josef
User avatar
Josef Templ
 
Posts: 1957
Joined: Tue Sep 17, 2013 6:50 am

Previous

Return to Resolved (Features)

Who is online

Users browsing this forum: No registered users and 2 guests

cron