Browse thread
Smart ways to implement worker threads
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ 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 Thu, Jul 15, 2010 at 1:24 PM, Goswin von Brederlow <goswin-v-b@web.de>
> wrote:
>
> It is too bad I don't want to learn 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.
>
> Â
>
> So could you give a short example? E.g. the merge sort from the book.
>
>
> You're right: OCaml's syntax differs enough from the text that it's annoying to
> cut-n-paste the examples. Fortunately most example are a few lines of code, so
> I didn't realize how difficult it could be on a larger example (like the merge
> sort example.)
>
> Attached is my translation of the mergeSort from the book. You get to play with
> it and see if it works  :)
Thanks. That is about what I got so I do seem to understand the
differences right.
For my use case this would then come down to implement solution 3 with
channels instead of my own queues. Well, channels are thread safe queues
just by another name. I think I see now how they make the code simpler
to write.
MfG
Goswin