next up previous contents
Next: 5.1.3.1 Shuttle server navigation Up: 5.1 Shuttles Previous: 5.1.2.4 Shuttles and Traps

5.1.3 Context switching

To switch the context from one shuttle to another we simply call property handlers. Note how predefined properties are honored last. We do not care how much time it takes to switch every property as we are running in the quantum of the entering shuttle.

<off_Shtl::switch_to implementation. >= (U->)
// Context switches to another shuttle. 
err_t off_Shtl::switch_to(off_Shtl *s)
{
  if (s->is_yielding())
    return switch_to(nd.get_shtl()+s->yields_to());
  stop();
  s->run();
  for (off_prop_t p=s->s_palloc.get_nalloc(); p-- >0; )
    s->s_palloc[p].pset(s->s_palloc[p].get_val(),s->get_id());

  if (s->get_dtlb()!=get_dtlb())
    s->s_mdep.set_dtlb(s->get_dtlb());

  s->s_mdep.switch_to(&s->s_mdep);
  return EOK;
}

\subsection{Shuttle navigation and inspection}

NOTE: Not yet implemented



 

Francisco J. Ballesteros
1998-05-25