Dan Sugalski <[EMAIL PROTECTED]> wrote: > At 8:26 AM +0200 6/25/03, Leopold Toetsch wrote:
>>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. If we want some secure executions modes too, we will need this anyway. The limit check in the 3 stacks I had put in is in the slow paths only. The same will work for the register stacks. ( /me again mumbling why we have 6 different stack implementations with a lot of duplicate code. One general stack with different sized data items would do it too - with some overhead ;-) > 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. Yes, comments do state this. So we need general COWable buffers plus some rework in stack code. >>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. This ought to be the same as not to have a separate control stack (as I mentioned above), but put a COWed copy of the callers control stack in place - at call time probably. > ... 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. I'm thinking of multithreading Parrot currently a lot and implications on some data structures. If you have any thouhgts floating around or even some finished bits please spit those out. leo