Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Concurrency for services
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Concurrency for services
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:

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).


Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology -
Team Notepad - intranets and extranets for business -