On 6 December 2015 at 01:58, Christopher Allan Webber <cweb...@dustycloud.org> wrote: > Amirouche Boubekki writes: >> 8sync has two types of async-request: >> >> ** run-requests, which implements kind of a *coroutine* behavior. >> >> It pause the execution of the current procedure and schedule >> the provided lambda to be run soonish; This doesn't exists in >> async.scm. The only thing useful this can do, is break the callstack >> to allow deeper recursion.
An aside on concurrency models: being able to do this - pause execution of one turn and allow another to run - creates a strictly more powerful model, but with very different properties for the purposes of analysis and auditing. It means that any time you call a function, you need to ensure that if there are properties that a turn must maintain - such as there being a constant amount of money in the system, for example - that this property is maintained /before/ the call. This feature is known as 'stale stack frames' in the literature (particularly in E circles), and in an ideal async world, we'd never need to do this. There's a really accessible post at https://glyph.twistedmatrix.com/2014/02/unyielding.html about what can happen as codebases grow in a system with the potential for stale stack frames. I also think https://wingolog.org/archives/2012/02/16/unexpected-concurrency is good to review when discussing this, even though it's dealing with a slightly different cause. I'm not saying that it's a bad idea to expose it in 8sync, btw. One great thing about Guile is that it gives you options about how you want to do concurrency. But libraries that use this feature (or may decide to use it in the future) should come with a large, flashing warning - calling these functions may allow other events to run! -- William Leslie Notice: Likely much of this email is, by the nature of copyright, covered under copyright law. You absolutely MAY reproduce any part of it in accordance with the copyright law of the nation you are reading this in. Any attempt to DENY YOU THOSE RIGHTS would be illegal without prior contractual agreement.