Hello Zelphir! Le sam. 4 janv. 2020 à 22:49, Zelphir Kaltstahl <zelphirkaltst...@posteo.de> a écrit : > > Hello Guile users! > > 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. The examples include one example using the > procedure `make-channel`, to create one channel for a client to send to > a server and one channel to use for the server to send messages to the > client. > > Are channels the only way to get a computation result back from a fiber? > > Should I be creating channels, which the spawned fiber then can use on > its own, to asynchronously give me a result? > > This is an aside of my actual project currently. I want to parallelize > some algorithm and want to make use of fibers for that, but in order to > do that, I must understand how to run multiple fibers and get their > results back. > > Can you give me an example, where fibers are used to split up a > computation heavy task so that it is sped up, because of running on > multiple cores? >
For that last bit, I have done the following in babelia: https://github.com/amirouche/guile-babelia/blob/87ae25b56777ab6072759bbe80bb80851d0d9174/babelia/pool.scm#L89-L108 I am wondering why the existing parallel for do not work for you: https://www.gnu.org/software/guile/manual/html_node/Parallel-Forms.html > Regards, > > Zelphir > > -- Amirouche ~ https://hyper.dev