[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Guile fibers return values
From: |
Zelphir Kaltstahl |
Subject: |
Re: Guile fibers return values |
Date: |
Sun, 5 Jan 2020 13:46:30 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 |
Thank you for your answer!
I think the example with channels, which I sent later goes in the
direction your are describing : )
Yes, I am not planning on modifying shared state and doing the whole
mutex stuff.
Regards,
Zelphir
On 1/5/20 3:42 AM, John Cowan wrote:
>
>
> On Sat, Jan 4, 2020 at 5:50 PM Zelphir Kaltstahl
> <address@hidden <mailto:address@hidden>> wrote:
>
> I have questions regarding the usage of the fibers library. It seems,
> that I cannot find any way to get a computation result back from a
> fiber. I also cannot find anything about how to get a value back
> from a
> fiber, except for channels.
>
>
> FIbers are much more like coroutines than subroutines: they don't
> return data, they pass it on. You *can* communicate by mutating
> shared data, but it's asking for trouble because of synchronization
> issues. Stick to communicating using channels, that's what they are
> for. Of course if your fiber both sends and receives on channels to
> the same fiber, you risk deadlock if you are not careful to stay
> exactly in sync and avoid output buffering. Exactly these rules
> apply to shell pipelines, probably the most widespread form of
> concurrency in programming as well as the simplest and most reliable.
>
>
>
> John Cowan http://vrici.lojban.org/~cowan
> address@hidden <mailto:address@hidden>
> Deshil Holles eamus. Deshil Holles eamus. Deshil Holles eamus.
> Send us, bright one, light one, Horhorn, quickening, and wombfruit. (3x)
> Hoopsa, boyaboy, hoopsa! Hoopsa, boyaboy, hoopsa! Hoopsa, boyaboy,
> hoopsa!
> --Joyce, Ulysses, "Oxen of the Sun"
>
- Guile fibers return values, Zelphir Kaltstahl, 2020/01/04
- Re: Guile fibers return values, Zelphir Kaltstahl, 2020/01/04
- Re: Guile fibers return values, Chris Vine, 2020/01/05
- Re: Guile fibers return values, Zelphir Kaltstahl, 2020/01/05
- Re: Guile fibers return values, Chris Vine, 2020/01/05
- Message not available
- Re: Guile fibers return values, Zelphir Kaltstahl, 2020/01/05
- Re: Guile fibers return values, Chris Vine, 2020/01/05
- Re: Guile fibers return values, Zelphir Kaltstahl, 2020/01/06
- Re: Guile fibers return values, Chris Vine, 2020/01/06