At 07:57 PM 6/21/2002 +0200, Jerome Vouillon wrote:
>On Fri, Jun 21, 2002 at 12:49:27PM -0400, Melvin Smith wrote:
> > >- Each co-routine should probably have its own interpreter.
> >
> > I'm not sure about this one. I think we can accomplish it without
> > the full overhead of a new interpreter.
>
>I don't understand.  It should not be much more expansive to create a

Any additional overhead than is needed is wasted overhead.

>interpreter than to copy a context, especially when you also need to
>allocate some new stacks.  So, it should be ok to create an new
>interpreter each time a co-routine is started.  And then, switching
>between the co-routine and its caller is just a matter of modifiying
>the "interpreter" pointer.

I understand what you are saying.

There are other things to consider. Each interp currently has
a seperate GC, IO, globals, register set, etc. which would throw
other things into the equation. Passing arguments in registers
would require copying. GC has to init and create pools.

Check out make_interpreter() in interpreter.c

Now, if you look at it and say we can do a "lightweight" interpreter, I think
that is what I'm trying to accomplish, but I'm calling it Parrot_Context.

I see nothing difficult about defining interpreter "context" switching
as a clean API to use. The problem is it currently isn't clean enough.

-Melvin


Reply via email to