Very light-weight cooperative concurrency?

Looking at Erlang’s actors, Go’s goroutines, Boost coroutines, Protothreads
and other implementations of cooperative concurrency, I was wondering what
has been done in this direction in ATS. What I found so far is only
https://bluishcoder.co.nz/2012/07/19/lightweight-tasks-library-for-ats.html.
Since this uses ucontext it is not as light-weight as I was imagining. I
would assume that this task library could be modified to use
sigsetjmp/siglongjmp.

What experiences have others made or what approaches have others pursued?

atscc2erl

I had no idea. :slight_smile:

Not much that I am aware of in this direction.

If you just want to use cooperative threads in ATS, then the simplest way
is probably
to make up an interface in ATS for Boost coroutines or protothreads.

Because ATS can be compiled to Erlang via atscc2erl, it makes sense to use
Erlang’s
actors as well.

If you know how your application is supposed to use cooperative threads,
then implementing
one based on setjmp/longjmp should be pretty quick. And it can be a lot of
fun as well.

Or, you could try to write your code in the continuation-passing style :)On Tue, May 3, 2016 at 1:02 PM, ‘Marko Schütz-Schmuck’ via ats-lang-users < ats-lan...@googlegroups.com> wrote:

Looking at Erlang’s actors, Go’s goroutines, Boost coroutines,
Protothreads and other implementations of cooperative concurrency, I was
wondering what has been done in this direction in ATS. What I found so far
is only
Lightweight Tasks Library for ATS.
Since this uses ucontext it is not as light-weight as I was imagining. I
would assume that this task library could be modified to use
sigsetjmp/siglongjmp.

What experiences have others made or what approaches have others pursued?


You received this message because you are subscribed to the Google Groups
“ats-lang-users” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/20a48485-bbdf-47c1-8284-96190488fa0c%40googlegroups.com
https://groups.google.com/d/msgid/ats-lang-users/20a48485-bbdf-47c1-8284-96190488fa0c%40googlegroups.com?utm_medium=email&utm_source=footer
.

atscc2erl

I had no idea. :slight_smile:

Here’s a good read: [1603.03727] Session Types in a Linearly Typed Multi-Threaded Lambda-Calculus (I think HX won’t post
it out of modesty. :-))