Co_Routines Support for Oberon

http://www.zinnamturm.eu/downloadsAC.htm#Co_ http://sourceforge.net/projects/ta1/files/co2.0

Re: Co_Routines Support for Oberon

Postby Josef Templ » Mon Apr 24, 2017 4:58 pm

Dmitry Dagaev wrote:There was no limitation of Transfer to main only. Nested coroutines allways were supported by Co_. Naturally, directed coroutine must return to the caller. The caller can be main or other coroutine. The same FILO discipline, as subroutine call and return.


Dmitry, you have modified my nested iterator example.
As far as I see, it is not possible to implement it with Co_.
I have tried it without success.
Please try it without cheating ;).

It was never the goal of the Coroutines module to compete with Co_, in particular
not with respect to its data flow programming support.
This is what I mean with special purpose versus general purpose.
There could also be a discrete event simulation framework somewhere
as CPC package but I would not include it in the standard distribution.
This does not mean that one is better than the other. It's just different.

- Josef
Josef Templ
 
Posts: 126
Joined: Tue Sep 17, 2013 6:50 am

Re: Co_Routines Support for Oberon

Postby Dmitry Dagaev » Mon Apr 24, 2017 5:31 pm

Josef,

You are cheating, not I do. The latest build you mentioned is http://blackboxframework.org/unstable/issue-%23156/blackbox-1.7.1-a1.849.zip. There are no nested coroutines example in ObxCoroutines there.
Dmitry Dagaev
 
Posts: 55
Joined: Wed Mar 29, 2017 3:58 pm

Re: Co_Routines Support for Oberon

Postby Ivan Denisov » Mon Apr 24, 2017 6:23 pm

Dmitry Dagaev wrote:There was no limitation of Transfer to main only. Nested coroutines allways were supported by Co_. Naturally, directed coroutine must return to the caller. The caller can be main or other coroutine. The same FILO discipline, as subroutine call and return.

I afraid that it was my wrong interpretation for Josef. However I am happy that this leads to dialog of you and Josef about this question. FILO is good, I believe.
User avatar
Ivan Denisov
 
Posts: 201
Joined: Tue Sep 17, 2013 12:21 am
Location: Krasnoyarsk, Russia

Re: Co_Routines Support for Oberon

Postby Dmitry Dagaev » Mon Apr 24, 2017 6:52 pm

Ivan,

The dialog is much better in this case. Otherwise (for example) center's Coroutines Sleep(0) implementation can never exceed 6% CPU. You have mentioned the problem, I've provided time comparisons.

By the way, I have 2 latest builts: 849 mentioned above and 852 http://blackboxframework.org/unstable/i%20...%20a1.852.zip yours. Are you planning to upgrade your version to Josef's last changes (Kernel.BeginCoroutines, Kernel.EndCoroutines)? Shall I implement new Co_ for your HostCoroutines also?
Dmitry Dagaev
 
Posts: 55
Joined: Wed Mar 29, 2017 3:58 pm

Re: Co_Routines Support for Oberon

Postby Josef Templ » Tue Apr 25, 2017 6:32 am

Dmitry Dagaev wrote:Josef,

You are cheating, not I do. The latest build you mentioned is http://blackboxframework.org/unstable/issue-%23156/blackbox-1.7.1-a1.849.zip. There are no nested coroutines example in ObxCoroutines there.


The example I am referring to is the nested iterator example https://community.blackboxframework.org/viewtopic.php?f=54&t=164&start=70#p1023. It has been posted a few messages earlier in this thread.
It is not in the ObxCoroutines module and I never claimed that.

There is currently a problem with the build engine (or Edis host) that Ivan is working on.
The latest build 856 for branch issue-#156 failed. Sorry for any inconveniences.
If you want to do any tests in the meantime you could download the source code
of Coroutines directly from https://github.com/BlackBoxCenter/blackbox/blob/issue-%23156/System/Mod/Coroutines.odc.

- Josef
Josef Templ
 
Posts: 126
Joined: Tue Sep 17, 2013 6:50 am

Re: Co_Routines Support for Oberon

Postby Dmitry Dagaev » Tue Apr 25, 2017 7:33 pm

Your example, please:
Main creates A
A creates B
A transfers to B
B yields to A
A transfers to B
B yields to A
A transfers to B
B yields to A
A transfers to B
B yields to A
A transfers to B
B yields to A
A transfers to B
B yields to A
A yields to Main

I just removed (*ASSERT(current = NIL, MUST_BE_PRIMARY);*) protection in Co_Routines. It is mandatory for BlackBox without Kernel Coroutines support for prohibition to allocate inside coroutine. It is not needed if Kernel's GC is available of coroutine's local stacks. I hope I can trust Center's new Kernel Coroutines support would be also included in further BlackBox releases.


StdCoder.Decode ..,1 ..i.....5uPzu9PuP7v9ZuPf9RHfP9vQRtP7vMCory3sH39SduRTfH
9vQdPN7f9T9N513.,...
1Ak...3i,...58FTuPE,5TWyqlKrqKKrGrtumdGLmGorCquU2hgnRAXDFTvMUn7FTvMf1G2sET
fPdP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GRqHE0HEGpb0mO0GWyo4ak2aEakd.Eu8r
kuqtOqm8rt0Guya0J2.N0MMRdMR7JZPMUvgV7MFQ5Y7Q8.AjdhAC5gdVBhiN8r,Y7kVUj,9WU.
q..cIffPJtCPM0O34KR00in4I6.UdQbUAAb8R11AVAVHdQUBBgdphUQgmhAkU80UA,SJYaIaKI
EurkummyKt0GWyo4M0YemBA.g6qk2KIb2YGhiiRbBAVBgcCZ65uPzuH.YCum4qE,Corypb..8p
uuK,5TeK45uPR9RyKqmqm8rtumdYg1ZimZh2hgnRg.AyI,.ELCoruKu.GomCrl0U1VV,u0IC..
.Qii..70,cw7.,.d.,.HE.2U..U,IklbeZFdKLqKKtCLLC3ZORNX2V.AyI,ktuGdKLqKa2V.Iy
1U.2.i8S.C80E.QE.sQRtIQeoBjghg2hgn7.X5.u0n9PU.Iy56.2.U6UO,,U00.umUG5kmY62.
7.,..Y22U,2.2.2YXK96.Xxs1kDz41.1.,6.Ikmj,6..EBU.U,.J,U.2m,.,.E4WDN.Ntarm3W
j.JklbcjlqK4Qcj,.E72.0..2,2.M00.dPLbHESmF3kwL,,AzJEu1Ko2oe2H.f40...
--- end of encoding ---
Dmitry Dagaev
 
Posts: 55
Joined: Wed Mar 29, 2017 3:58 pm

Re: Co_Routines Support for Oberon

Postby Ivan Denisov » Wed Apr 26, 2017 4:43 am

Dmitry Dagaev wrote:By the way, I have 2 latest builts: 849 mentioned above and 852 http://blackboxframework.org/unstable/i%20...%20a1.852.zip yours. Are you planning to upgrade your version to Josef's last changes (Kernel.BeginCoroutines, Kernel.EndCoroutines)? Shall I implement new Co_ for your HostCoroutines also?


IMHO, extra work is not required for now. Let's wait a bit. If Center will force to use Josef's Kernel embedded implementation ignoring all my claims for the preliminary voting I have to start parallel project with the focus to cross-platform solutions. Josef said earlier that he does not see the reasons for cross-platform capabilities for BlackBox and this leaves an imprint for all solutions he is developing. Because his professionalism is valuable and is not compensating by the discussion and voting process that shifts the focus of Center activity to Windows. So the goals of the Center for multiple platforms can not be reached with such team. I do not see perspectives.
User avatar
Ivan Denisov
 
Posts: 201
Joined: Tue Sep 17, 2013 12:21 am
Location: Krasnoyarsk, Russia

Re: Co_Routines Support for Oberon

Postby Dmitry Dagaev » Fri Apr 28, 2017 4:08 pm

luowy wrote:if we can implement the coroutine use stackless tech, maybe we can make

Josef Templ wrote:an optimization for special cases offered by some languages but it needs a language change and heavy optimizations in the compiler

I've written before https://community.blackboxframework.org/viewtopic.php?f=54&t=164&start=40#p992 that Kernel support for stacks&traps must be separated from Coroutines implementation. HostCoroutines subsystem gives anybody an opportunity to reimplement coroutines in custom way.

By the way the 2-nd BlackBox coroutines implementation by Ilya Ermakov (not published) uses transfer implementation by register switching:
Code: Select all
      S.GETREG(4, current.esp);
      S.GETREG(5, current.ebp);
                ...
      S.PUTREG(4, mainEsp);
      S.PUTREG(5, mainEbp)

I think anybody can easily implement HostCoroutines.Transfer in such a way or with ASSEMBLY [code] with better performance.
Dmitry Dagaev
 
Posts: 55
Joined: Wed Mar 29, 2017 3:58 pm

Re: Co_Routines Support for Oberon

Postby Dmitry Dagaev » Fri Apr 28, 2017 4:15 pm

luowy wrote:our framework can provide two std scheduler

Co_SchedTasks can be reimplemented in standart BlackBox way for your own needs.
Co.scheduler and Co.stdScheduler are factories like Files.dir, Files.stdDir.
Dmitry Dagaev
 
Posts: 55
Joined: Wed Mar 29, 2017 3:58 pm

Re: Co_Routines Support for Oberon

Postby Dmitry Dagaev » Fri Apr 28, 2017 5:08 pm

luowy wrote:certainly,coroutine must has "state" field;
then user's can use "resume","yeild","sleep"

Co_ is based on Carrier-Link-Rider model: Scheduler-Dispatcher-Coroutine. Scheduler holds state, the basic states are:
ST_READY* = 1; ST_LOCKED* = 2; ST_FINISHED* = 3; ST_SUSPENDED* = 4;
ST_NEXTREADY* = 5; ST_SLEEP* = 6;
Dispatcher with states can be reimplemented for Custom needs like Scheduler.

Co_ObxShakesPeare demonstrates Finite State Machine example:
Code: Select all
   PROCEDURE Next (r, rnext: Player);
   BEGIN
      r.Suspend;
      rnext.Resume;
      rnext.SchedSleep(1000);
   END Next;

   PROCEDURE (r: Desdemona) Do ;
   BEGIN
      Say(r, "Your honour is most welcome.");
      Next(r, othello); Co.Yield;
      Say(r, "My lord?");
      Next(r, othello); Co.Yield;
      Say(r, "I will, my lord");
      Co.Stop
   END Do;

Next suspends and resumes execution state and schedulers Co_Routine to wakeup after 1000 ms.
Dmitry Dagaev
 
Posts: 55
Joined: Wed Mar 29, 2017 3:58 pm

Previous

Return to Co_

Who is online

Users browsing this forum: No registered users and 1 guest

cron