~icefox/garnet-wiki

e941c2656a7abca307476f513aee72807d061140 — Simon Heath 2 months ago 4091b67
test
1 files changed, 1 insertions(+), 1 deletions(-)

M thoughts.md
M thoughts.md => thoughts.md +1 -1
@@ 2226,4 2226,4 @@ It's weird 'cause coroutines are both a closure and a struct.  hmmm.  Well the w

Basically, a coroutine is a sub-tree in our cactus-style call graph.  A lifetime is a pointer from some node in the cactus to some node higher up in the same sub-branch.  Calling a coroutine lets you jump from one branch into some place in that other sub-tree.  --But with ownership, that jump is only valid if it goes upwards in the cactus, I think.  Moving a coroutine lets you snip that sub-tree off of where it came from and glue it on somewhere else, so you can move a coroutine between branches of the cactus.  -- but only if it doesn't have any pointers into the branch it's leaving.

...this brings up the interesting property that, inside a coroutine, it might be possible to have pointers that go downward in its subtree safely, as long as they don't leave its subtree by being passed into another coroutine call.  Because the whole subtree of the coro is allocated and freed as a unit, generally.  I don't even want to *try* to think about that right now.
...this brings up the interesting property that, inside a coroutine, it might be possible to have pointers that go downward in its subtree safely, as long as they don't leave its subtree by being passed into another coroutine call.  Because the whole subtree of the coro is allocated and freed as a unit, generally.  I don't even want to *try* to think about that right now.