apoch / epoch-language

Home of the Epoch Programming Language Project
Other
72 stars 3 forks source link

Reimplement threading support #127

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Threading support needs to be reimplemented, basically from scratch, using the 
entity model for code markup.

Possible features:

 - Spin off a new thread with some kind of syntax/markup
 - Pass messages between threads
 - Ensure shared state is minimized or at least somehow explicit in the code
 - "async/await" style functionality, or some other cooperative scheduling
 - Futures
 - Atomics
 - Locks
 - Other thread synchronization primitives (semaphores, events, condition variables, etc.)

Original issue reported on code.google.com by don.ap...@gmail.com on 15 Feb 2012 at 7:59

GoogleCodeExporter commented 9 years ago
print_things : task things
{
    string thing = things.get_string()
    while(thing != nil) {
        print(thing)
        thing = things.get_string()
    }
}

entrypoint :
{
    task thingPrinter = task(print_things)
    string thing = io.read_line()
    while(len(thing) > 0)
        thingPrinter.send(thing)
}

Original comment by ryoohki@gmail.com on 15 Feb 2012 at 8:08

GoogleCodeExporter commented 9 years ago
I've considered things like stackless python's channels to be a lot nicer than 
most other forms of inter-thread communication...

the above would, presumably, wait in a blocking state on get_string(), while 
the entrypoint would read in and pass that data (via the task's channel).

Original comment by ryoohki@gmail.com on 15 Feb 2012 at 8:12