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
Problems spawning threads
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-12-18 (17:13)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] Problems spawning threads
On Tuesday 18 December 2007 05:18, Edgar Friendly wrote:
> I've gone over the Computer Language Benchmarks Game[1] problems, and I
> can't figure out how help the administrators of this problem to get the
> OCaml code for the thread-ring benchmark (contributed by Charles Martin)
> to work on their computer.

This benchmark is subjective, ill-defined and trivially reducible. 
Consequently, your competitors aren't using real system threads but the 
shootout maintainers will probably reject your submission if you don't. You 
could pull in a more suitable "thread" library like LWT:

However, once you pull in that code and write the benchmark you'll be able to 
trivially reduce it until it is just a "print" statement. At some point the 
shootout maintainers will choose to start rejecting your submissions and call 
you a "cheat" for writing better code.

The same is also true of binary-trees, chameneos-redux, mandelbrot, nsieve, 
nsieve-bits, partial-sums, pidigits and recursive.

In summary, this is a complete waste of time and effort. I would love to see 
simple tutorial examples of threading, concurrency and parallelism in OCaml. 
If you decide to embark on such a project, please choose examples that are 
objective, relevant and not trivially reducible.

I would be very interested to see parallel implementations of 
the "n"th-nearest neighbour example from my book, for example. I have been 
trying and failing to write an elegant functional implementation of that 
myself for some time now... :-)

Dr Jon D Harrop, Flying Frog Consultancy Ltd.