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

yarn: threading library #324

Open
TorchedSammy opened this issue Aug 18, 2024 · 0 comments
Open

yarn: threading library #324

TorchedSammy opened this issue Aug 18, 2024 · 0 comments

Comments

@TorchedSammy
Copy link
Member

TorchedSammy commented Aug 18, 2024

to expand on the hilbish.goro function and add something a bit more safe, a threading library can be worked on. i will not port this to midnight edition, as that is too much to try and wrap my head around.

this "threading" library would just be a way to create independent lua states via the lua api and to be able to run them to do parallelization tasks or something in the background. then there is the possibility of removing the hilbish.goro function at v3.

proposed api:
yarn.create() will create a new thread (which is just a separate lua state/runtime)
yarn.clone(t?) can clone the main thread (or t if passed), though this might be a bit slow.

some type of channels type is needed to pass values from one thread to another?

some sources of inspiration:
https://github.com/yuin/gopher-lua#goroutines
https://github.com/effil/effil#quick-guide

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

1 participant