From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id EAA29771; Sun, 29 Apr 2001 04:00:01 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id EAA29422 for ; Sun, 29 Apr 2001 04:00:00 +0200 (MET DST) Received: from mta6.snfc21.pbi.net (mta6.snfc21.pbi.net [206.13.28.240]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f3T1xwr22065 for ; Sun, 29 Apr 2001 03:59:58 +0200 (MET DST) Received: from checkerlap.d6.com ([64.160.53.33]) by mta6.snfc21.pbi.net (Sun Internet Mail Server sims.3.5.2000.01.05.12.18.p9) with ESMTP id <0GCJ00CD26VBQ3@mta6.snfc21.pbi.net> for caml-list@inria.fr; Sat, 28 Apr 2001 18:59:36 -0700 (PDT) Date: Sat, 28 Apr 2001 19:00:29 -0700 From: Chris Hecker Subject: [Caml-list] "yielding" in bytecode X-Sender: def6@shell16.ba.best.com To: caml-list@inria.fr Message-id: <4.3.2.7.2.20010428145201.00d75aa0@shell16.ba.best.com> MIME-version: 1.0 X-Mailer: QUALCOMM Windows Eudora Version 4.3.2 Content-type: text/plain; charset="us-ascii" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I'd like to use ocaml bytecode embedded in another application, so I'll be calling caml_startup() from C code. I'd like to be able to have bytecode functions yield back to the calling C code but maintain their state when resumed. I'm not talking about full continuations or anything fancy like that, I'm just talking about breaking out of the interpreter loop and storing the state, so that when it's reentered (via a new API, like caml_resume() or something) it continues executing. I don't think there's any way to do this right now, but it looks like it'd be possible. Is there any reason this couldn't be made to work? In addition, a couple more related features would be nice for embedding ocaml as a scripting language: - non-preemptive threads (aka fibers), this would be especially good if it was integrated with the above yield thing, so you could yield and then C code could resume individual fibers as it wanted - having the ocaml byterun state be packaged up in a structure instead of using globals, so you could run multiple copies of it...not sure what kind of performance impact this would have, though...maybe it could be a compile time option, I guess you'd have multiple GCs too... Chris ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr