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 HAA24832; Thu, 18 Dec 2003 07:46:06 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id HAA25019 for ; Thu, 18 Dec 2003 07:46:04 +0100 (MET) Received: from mail.davidb.org (adsl-64-172-240-129.dsl.sndg02.pacbell.net [64.172.240.129]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hBI6k2X27239; Thu, 18 Dec 2003 07:46:03 +0100 (MET) Received: from davidb by mail.davidb.org with local (Exim 3.36 #1 (Debian)) id 1AWruz-00024v-00; Wed, 17 Dec 2003 22:45:53 -0800 Date: Wed, 17 Dec 2003 22:45:53 -0800 From: David Brown To: Brian Hurt Cc: Nicolas Cannasse , Pierre Weis , Falk Hueffner , caml-list@inria.fr Subject: Re: [Caml-list] Python's yield, Lisp's call-cc or C's setjmp/longjmp in OCaml Message-ID: <20031218064553.GA7948@davidb.org> References: <004c01c3c504$62407b80$0274a8c0@PWARP> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.4i X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 caml-list:01 python's:01 lisp's:01 c's:01 0600,:01 stupid:01 ocaml:01 closure:01 stack:02 thread:02 dave:03 wrote:03 recursive:03 reproduce:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, Dec 18, 2003 at 01:05:20AM -0600, Brian Hurt wrote: > > Doing it using a closure is more difficult, since we need to reproduce the > > stack using a data structure. That goes of course for all recursive data > > structures. > > > > Stupid question: would it be possible/usefull to have the yielding > function run as a seperate thread of execution, in a produce/consumer sort > of way? Yes. But if the computation per context switch is low a large portion of the CPU will be spent doing the context switches. Dave ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners