Skip to content

yarn: threading library #324

Open
Open
@sammy-ette

Description

@sammy-ette

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions