Skip to content

threads #36

Description

@luciusmagn

Implement basic threads:

// syntax is a to-do, too, a bit
//spawns a new thread with the identifier 'myname'. Thread names are optional
thread myname {
    stuff1();
    stuff2();
    etc();
}

join myname; //joins a thread, no-op if thread has already finished

let x = 5;
let y = 6;

// captures variables for a thread. Currently unsure if it should actually move them or just copy
// Not really sure about syntax here
thread |x, y| {
    print(x);
    print(y);
}

// all threads are joined when the main script thread is about to finish to prevent threads being stopped unexpectedly

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions