This is the mail archive of the
guile@sources.redhat.com
mailing list for the Guile project.
Re: continuation and multi-threading
- To: Keisuke Nishida <kxn30 at po dot cwru dot edu>
- Subject: Re: continuation and multi-threading
- From: Mikael Djurfeldt <mdj at mdj dot nada dot kth dot se>
- Date: 01 Aug 2000 22:33:22 +0200
- Cc: djurfeldt at nada dot kth dot se, guile at sourceware dot cygnus dot com
- Cc: djurfeldt at nada dot kth dot se
- References: <m3g0oqnjrp.fsf_-_@indy.STUDENT.CWRU.Edu><m3d7jxa9gv.fsf@indy.STUDENT.CWRU.Edu><p2tpunx85vu.fsf@bohne.zrz.tu-berlin.de><m33dksvk8i.fsf@indy.STUDENT.CWRU.Edu><200007311359.NAA00736@ruebe.zrz.tu-berlin.de><AD4WUXvScB@khim.sch57.msk.ru> <m3wvi2m0pw.fsf@indy.STUDENT.CWRU.Edu><87punux90c.fsf@piracy.red-bean.com><m3ya2h1vk4.fsf@indy.STUDENT.CWRU.Edu><873dkpwmw5.fsf@piracy.red-bean.com><m3vgxlo5db.fsf@indy.STUDENT.CWRU.Edu><xy73dkohlvy.fsf@mdj.nada.kth.se><m3ittkpxav.fsf@indy.STUDENT.CWRU.Edu><xy7ya2geoc2.fsf@mdj.nada.kth.se> <xy7punsenyt.fsf@mdj.nada.kth.se><m3em48pw8z.fsf@indy.STUDENT.CWRU.Edu>
- Reply-To: djurfeldt at nada dot kth dot se
Keisuke Nishida <kxn30@po.cwru.edu> writes:
> Mikael Djurfeldt <mdj@mdj.nada.kth.se> writes:
>
> > > Is your VM using a stack of its own? In that case, you might have to
> > > take a copy of both stacks.
> >
> > (I.e., VM stack and C stack.)
>
> Could I use setjump?
Sure. This is what is being used now. This is the implementation of
call/cc in Guile (from eval.c:2232 with irrelevant details edited out):
case (SCM_ISYMNUM (SCM_IM_CONT)):
scm_make_cont (&t.arg1);
if (setjmp (SCM_JMPBUF (t.arg1)))
{
SCM val;
val = SCM_THROW_VALUE (t.arg1);
return val;
}
proc = SCM_CDR (x);
proc = evalcar (proc, env);
goto evap1; /* apply proc on t.arg1 */
BTW, what did you mean with 'arranges the return value'?