Version franÁaise
Home ††† About ††† Download ††† Resources ††† Contact us †††
Browse thread
Smart ways to implement worker threads
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Goswin von Brederlow <goswin-v-b@w...>
Subject: Re: [Caml-list] Smart ways to implement worker threads
Rich Neswold <rich.neswold@gmail.com> writes:

> On Wed, Jul 14, 2010 at 11:09 AM, Goswin von Brederlow <goswin-v-b@web.de>
> wrote:
>
>     4) Do some magic with Event.t?
>
>     Problem: never used this and I could use a small example how to use
>     this.
>
>
> Event.t (and its associated library) *is* magical in that it provides an
> absolutely beautiful concurrent programming model. Forget about select() and
> mutexes and other ugly threading concepts. Event.t and friends is how it should
> be done.
>
> John H. Reppy's "Concurrent Programming in ML" provides a thorough
> understanding of how to use this module effectively. This book presents the
> material in a very understandable way: deficiencies in current threading
> models are discussed as well as how CML solves the limitations and constraints.
> The book can be purchased or downloaded free online.

It is too bad I don't want to lear CML but use Ocaml. The CML examples
from the book don't translate into ocaml since the interface is just a
little bit different and those differences are what throws me off. I
figue spawn becomes Thread.cread and I have to add Event.sync or
Event.select and Event.wrap at some points. At which point the book
becomes useless to understanding how Ocamls Event module is to be used
I'm afraid. Also doesn't tell me what Ocamls limitations and constraints
are.

So if you have used this in ocaml could you give a short example?
E.g. the merge sort from the book.

MfG
        Goswin