At 8:26 AM +0200 6/25/03, Leopold Toetsch wrote:
<x-flowed>Dan Sugalski wrote:

At 10:33 AM +0200 6/24/03, Leopold Toetsch wrote:

I've added a check for too deeply nested stacks now.

 I probably ought to get started on the stack-chunk-as-PMC patch for
 garbage collection of stack frames. :)

The first question is: Do we need such a limit check on the register backing stacks too?

If we're going to put limits in, yes.


Second is efficiency on copying COWed stacks. Currently only Control,
Pad, and User stacks are lazy copied, whole stack at once and not
chunkwise. So it would make sense to have stack chunks derived from
buffer-like objects, which can be unCOWed per chunk.
But this would need some rework in the COW GC code, which currently
assumes that only strings might be COWed.

I could've sworn that the stacks were taken piece by piece when COWed, but apparently not. They should be, though, as should the register stacks. No point in copying more data than we need to when we touch the things.


WRT coroutines: They have new_stack()s for Pad, User, and Control. The
latter is probably wrong due to the planned exception mechanism. I
presume that a coroutine works like a subroutine WRT exceptions, so that
some parent can catch an exception that has originated in a coroutine.

Co-routines are going to have to be dealt with oddly, since their stacks need to reattach themselves to the caller's stack (at least the control stack) on every invocation. That is, the bottom of the coroutine's stack needs to attach to the top of the current stack every time the coroutine is invoked, which can be... fun. Especially if we need to deal with the possibility of multiple threads invoking the same coroutine, something that just occurred to me that I don't muck like the implications of.
--
Dan


--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to