[Gauche-devel] Implementation of Futures
R7RS Scheme scripting engine
Status: Beta
Brought to you by:
shirok
|
From: Glenn T. <gl...@ne...> - 2023-02-09 06:44:14
|
2023-2-8 Hello! Just curious about how futures is implemented. A short description would suffice with respect to some code I was playing with (it's attached to this email just for fun). The Gauche documentation on futures says that "future" calls code in a separate thread (I assume a Posix pthread). So I get the feeling that a "future" is like "pthread_create" in C. And that "future-get" can be likened to "pthread_join". The structure of the programs between Scheme and C look alike. But the output returns after "future-get" is random. The output result from pthread_join is usally not. This is not a problem for me. I'm just curious as to why this happens. The behavior using Guile scheme is similar with random output results from "touch". This question might seem weird to you, and I apologize if so. I'm just curious. Thanks. Glenn |