[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: about coroutines

From: Michele Bini
Subject: Re: about coroutines
Date: Fri, 23 Nov 2001 01:38:13 +0100

>>>>> "Marius" == Marius Vollmer <address@hidden> writes:

  Marius> Michele Bini <address@hidden> writes:
  >> I think that there is a problem with storing continuations for
  >> coroutines in lexically scoped (non-global) variables or passing
  >> them as arguments or as return values, since when you create a
  >> continuation to save the current execution point for a coroutine
  >> there is the risk that a reference to the continuation for a
  >> previous execution point still exists (in the stack); when this
  >> happens a chain of unfreeable continuations will accumulate over
  >> time.

  Marius> Do you think this is a bug on Guile's part, or is it
  Marius> unavoidable?  I plan to find the precise location where the
  Marius> continuation references stick...

Well, i don't think this can be regarded as a bug, probably more of a
weakness intrinsic in C scheme implementations using conservative
garbage collection and stack-copying based continuations.
Scheme programmers should be perhaps suggested to clearly encapsulate
continuations references in other scheme objects, when using them for
anything more complex than non-local exits, to avoid polluting the
stack with spurious references.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]