mit-scheme-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MIT-Scheme-devel] sqlite3


From: Taylor R Campbell
Subject: Re: [MIT-Scheme-devel] sqlite3
Date: Sat, 18 May 2013 23:23:16 +0000
User-agent: IMAIL/1.21; Edwin/3.116; MIT-Scheme/9.1.1

   Date: Sat, 18 May 2013 12:40:04 -0700
   From: Matt Birkholz <address@hidden>

   > From: Taylor R Campbell <address@hidden>
   > Date: Fri, 17 May 2013 03:13:38 +0000
   > 
   > Scheme48 has a working implementation of this.  When C calls into
   > Scheme, it passes Scheme a token and a return-to-c continuation to
   > which Scheme must return the token. [...]

   That would be cool.  I have often pondered such a scheme, but I would
   be anxious to get out of C space and into Scheme.  Thus I would
   re-apportion the work thusly:

       C calls into Scheme (as usual).  The Scheme callback-handler notes
       the new state of the C stack, applies the chosen handler (with
       optional thread switching), waits until the C stack has returned
       to the noted state (if necessary), and returns.

That is basically what I implemented in my follow-up with message-id
<address@hidden>.

   I think a slightly more sophisticated callback-handler is all you
   need.  Why write *any* more C code? :-)

Scheme48 has a working implementation of this, and it involves some
nontrivial logic in C.  I don't yet understand why, but until I do
understand I'm going to assume that there is some reason it's
necessary.  I would guess it has something to do with handling throws
by longjmp.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]