From: Jim Pryor Date: Sun, 28 Nov 2010 11:20:09 +0000 (-0500) Subject: zipper: coroutine links X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=commitdiff_plain;h=9273d85724c80393c8ec4dea26705c47ccdf10c8 zipper: coroutine links Signed-off-by: Jim Pryor --- diff --git a/zipper.mdwn b/zipper.mdwn index ca8bf31a..9c01a56f 100644 --- a/zipper.mdwn +++ b/zipper.mdwn @@ -424,14 +424,14 @@ With cooperative threads, one typically yields control to the thread, and then b If you want to read more about these kinds of threads, here are some links: -* [[!wikipedia Computer_multitasking]] -* [[!wikipedia Thread_(computer_science)]] + * [[!wikipedia Coroutine]] * [[!wikipedia Iterator]] * [[!wikipedia Generator_(computer_science)]] * [[!wikipedia Fiber_(computer_science)]] -* [[!wikipedia Green_threads]] -* [[!wikipedia Protothreads]] + The way we built cooperative threads here crucially relied on two heavyweight tools. First, it relied on our having a data structure (the tree zipper) capable of being a static snapshot of where we left off in the tree whose fringe we're enumerating. Second, it relied on our using mutable reference cells so that we could update what the current snapshot (that is, tree zipper) was, so that the next invocation of the `next_leaf` function could start up again where the previous invocation left off.