Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coroutines #6

Open
pmcgee69 opened this issue Jan 20, 2023 · 2 comments
Open

Coroutines #6

pmcgee69 opened this issue Jan 20, 2023 · 2 comments

Comments

@pmcgee69
Copy link

Looking at your example here ... https://sudonull.com/post/32157-Mash-multithreading-coroutines-async-wait

proc main():
  cor3 ?= new TCoroutine(false, null)
  cor3 -> Execute ?= class::Proc3
  cor2 ?= new TCoroutine(false, cor3)
  cor2 -> Execute ?= class::Proc2
  cor1 ?= new TCoroutine(false, cor2)
  cor1 -> Execute ?= class::Proc1
  cor3 -> NextCoroutine ?= cor1
  cor1 -> Resume()
  InputLn()
end

Might as well have an overload TCoroutine( boolean, TCoroutine, TProc ) ... ?

proc main():
  cor3 ?= new TCoroutine(false, null, class::Proc3)
  cor2 ?= new TCoroutine(false, cor3, class::Proc2)
  cor1 ?= new TCoroutine(false, cor2, class::Proc1)
  cor3 -> NextCoroutine ?= cor1
  cor1 -> Resume()
  InputLn()
end
@RoPi0n
Copy link
Owner

RoPi0n commented Feb 1, 2023

Lol, someone translated my post's into english

@RoPi0n
Copy link
Owner

RoPi0n commented Feb 1, 2023

Yes, why not to override it. But this implementation based on threads and not a true coroutine. I wrote this project in education purposes only. @pmcgee69

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants