From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id E2FDABCAE for ; Wed, 13 Jul 2005 10:50:55 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j6D8otLV010470 for ; Wed, 13 Jul 2005 10:50:55 +0200 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 KAA14108 for ; Wed, 13 Jul 2005 10:50:55 +0200 (MET DST) Received: from furbychan.cocan.org (furbychan.cocan.org [80.68.91.176]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j6D8oseo018261 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 13 Jul 2005 10:50:55 +0200 Received: from rich by furbychan.cocan.org with local (Exim 3.35 #1 (Debian)) id 1Dsd5U-0008RF-00 for ; Wed, 13 Jul 2005 09:59:28 +0100 Date: Wed, 13 Jul 2005 09:59:28 +0100 To: caml-list@inria.fr Subject: Re: [Caml-list] Concurrency for services Message-ID: <20050713085928.GA32362@furbychan.cocan.org> References: <20050713.004043.123299672.Christophe.Troestler@umh.ac.be> <1121229212.27378.23.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1121229212.27378.23.camel@localhost.localdomain> User-Agent: Mutt/1.3.28i From: Richard Jones X-Miltered: at nez-perce with ID 42D4D5EF.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 42D4D5EE.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 model:01 inverts:01 ocaml:01 ocaml:01 implements:01 threads:01 notepad:01 twist:98 wrote:01 functions:01 concurrency:02 src:95 src:95 jul:05 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: On Wed, Jul 13, 2005 at 02:33:32PM +1000, John Skaller wrote: > A twist with the Felix model is that the code is written > with 'read' commands, but the Felix translator control > inverts (twists) the code into event driven code. > > Actually a version for Ocaml is possible although I > haven't tried to create one yet -- Felix targets C++ > but it should work for any language which supports > classes with virtual functions and switches. It should definitely be possible in OCaml. For anyone who wants to see how this trick is done (in C using setcontext), also look at: http://www.annexia.org/freeware/pthrlib Specifically at the files src/pthr_reactor.c (an ordinary event Reactor) and src/pthr_pseudothread.c (implements threads using control inversion on top of the Reactor). Rich. -- Richard Jones, CTO Merjis Ltd. Merjis - web marketing and technology - http://merjis.com Team Notepad - intranets and extranets for business - http://team-notepad.com