coop - a concurrent ml-like wanna be (pre-SRFI) Amirouche (05 May 2021 18:30 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) Amirouche (06 May 2021 10:28 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) Marc Feeley (06 May 2021 14:27 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) Amirouche (06 May 2021 14:50 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) Alexey Abramov (06 May 2021 15:32 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) Marc Nieper-Wißkirchen (06 May 2021 15:41 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) Amirouche (06 May 2021 16:28 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) Marc Nieper-Wißkirchen (06 May 2021 16:37 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) Amirouche (06 May 2021 16:48 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) Marc Nieper-Wißkirchen (06 May 2021 17:22 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) Wolfgang Corcoran-Mathe (06 May 2021 19:13 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) Marc Nieper-Wißkirchen (06 May 2021 19:37 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) Wolfgang Corcoran-Mathe (06 May 2021 21:54 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) Marc Nieper-Wißkirchen (07 May 2021 07:01 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) Alex Shinn (07 May 2021 07:42 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) Marc Nieper-Wißkirchen (07 May 2021 08:35 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) Alex Shinn (07 May 2021 08:41 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) Marc Nieper-Wißkirchen (07 May 2021 08:58 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) Alex Shinn (07 May 2021 13:47 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) Amirouche (06 May 2021 19:36 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) Lassi Kortela (06 May 2021 19:40 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) Amirouche Boubekki (06 May 2021 21:25 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) Marc Feeley (06 May 2021 17:07 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) Amirouche (06 May 2021 21:01 UTC)
Re: coop - a concurrent ml-like wanna be (pre-SRFI) John Cowan (06 May 2021 21:25 UTC)

Re: coop - a concurrent ml-like wanna be (pre-SRFI) Amirouche Boubekki 06 May 2021 21:25 UTC

Hello and welcome Alexey!

Le jeu. 6 mai 2021 à 17:32, Alexey Abramov - levenson at mmer.org (via
srfi-discuss list) <xxxxxx@srfi.schemers.org> a écrit :
>
> Hi,
>
> I am new here, but i think https://github.com/wingo/fibers
> can be helpful.

coop is mostly inspired from guile fibers. It covers those part of the manual:

- https://github.com/wingo/fibers/wiki/Manual#22-operations

- https://github.com/wingo/fibers/wiki/Manual#23-channels

Except I renamed them to look more like R7RS.

The rest is very specific to Guile. A work-stealing feature may be
implemented on top of coop, or below coop.

Gambit with the SMP flag turned on implement a similar feature to
work-stealing as far as I understand.

I did not write the full list of references yet.

I did not re-use fibers code, but I did a pull-request with a few comments.

The essential aspect I missed while reading the original CML paper is
that there is a lock shared among all operations that are applied.
Also coop-choice make it looks like operations are nested, but in fact
they are flat (coop-choice some-produce some-consume (coop-choice
some-sleep some-consume2)) is equivalent to (coop-choice some-produce
some-consume some-sleep some-consume2), the order of operations does
not matter, they are tried in some unspecified order, possibly taking
into account priority. fibers and the original CML paper mention
randomization.

coop-wrap and coop-sleep are essential for robust code.