On Fri, Jun 21, 2002 at 06:22:40PM -0400, Melvin Smith wrote:
> At 10:22 PM 6/21/2002 +0200, Jerome Vouillon wrote:
> >Ok.  Then, you should do the converse to what you are mentionning in
> >your patch: instead of inlining a context in the interpreter structure
> >(Parrot_Interp), you should add a field in Parrot_Context containing a
> >pointer to a shared Parrot_Interp structure.  (And the bytecode
> >interpreter should use Parrot_Context wherever it uses Parrot_Interp
> >at the moment).
> 
> What benefit would we get?

We get cheap context switching for (cooperative) threads and
co-routines: no need to copy one kilobyte of data at each context
switch.

> Adding a level of indirection loses a bit of speed in often accessed
> structure members. So anything that holds the top level struct has 2
> levels of indirection in your way.

We can move the most often accessed members to the context structure.
Most of them (registers, stacks) will be in this structure anyway.

-- Jerome

Reply via email to