Re: relinquishing timeslices in a transaction

Richard Kelsey <[email protected]>
Newsgroups gmane.lisp.scheme.scheme48
Message-ID <[email protected]>
   Date: Tue, 15 Sep 2009 15:15:54 -0400
   From: Taylor R Campbell <[email protected]>

   When the Scheme48 virtual machine delivers an interrupt, it saves the
   current proposal, to be restored when control returns from the
   interrupt handler.  This is how per-thread proposals are preserved
   when switching threads in the timer interrupt handler,

Not quite.  Each thread has its own proposal, so switching
threads automatically switches proposals as well, whether
or not an interrupt is involved.  The virtual machine
keeps the current proposal in a fixed slot of the current
thread, which is itself kept in a VM register.  There is
no separate proposal register.

   but how are they preserved when switching threads using
   RELINQUISH-TIMESLICE?  I don't see any evidence that it saves the
   current proposal anywhere.

The virtual machine interrupt handler has to save the
proposal because the run-time interrupt handler runs in the
current thread but doesn't want to use or affect the current
proposal, if any.  Not changing the thread avoids the need
to switch continuations on every interrupt.

                                    -Richard
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.