This is the mail archive of the guile@sources.redhat.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: How often are continuations created?


> This algorithm is quite simple and must be efficient for both regular
> procedure calls and continuation calls, as long as there are sufficient
> stack segments on the free list.

In effect you are saying that the stack-copying algorithm only needs to
copy data and not control but if a continuation exists in a global variable
then there is no reason why that same continuation could not be invoked
many times over (yeah, I realise that the result is a program of minimal
sanity but that is beside the point).

If you are going to invoke the same continuation over and over then you
pretty much have to copy EVERYTHING on the stack...

The other point that I would like to make is that a typical subroutine
call would have about three parameters (I haven't measured this, I'm just
pulling the value out of my head) so for each one return address there are
three data pointers which make the data stack bigger than the control
stack. Then there are local variables and so on...

>  But if only a limited number of
> continuations are created at once, there will be neither memory
> allocation nor stack copying (except a few data stack copying).

I would estimate that most of the bulk will be in the data stack
which you are still copying. What makes you think the data stack will
be insignificant?

	- Tel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]