epoch-language
epoch-language copied to clipboard
Reimplement threading support
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 [email protected] on 15 Feb 2012 at 7:59
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 [email protected] on 15 Feb 2012 at 8:08
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 [email protected] on 15 Feb 2012 at 8:12