Christophe TROESTLER wrote: > On Wed, 08 Feb 2006, Xavier Leroy wrote: > >>Could you please tell us where to find the OCaml code you're >>discussing? I haven't seen it anywhere on the Web page you posted. > > > Sorry. You get the code by clicking on the language name: > http://shootout.alioth.debian.org/gp4/benchmark.php?test=chameneos&lang=all > The task description is at the bottom of the page. > > The one similar to MLton is: > http://shootout.alioth.debian.org/gp4/benchmark.php?test=chameneos&lang=ocaml&id=0 Wow! It's incredible to see just how slow an algorithm can become when threading is used. A vanilla userland scheduler can produce a three-order of magnitude speedup over a threading library. I'm attaching an implementation of chameneos which uses a batched queue à la Okasaki to schedule chameneos meetings. Obviously, this algorithms is absolutely deterministic, while the implementation using threads follows a random execution path, which is in general different at every execution of the program. Yet the program satifies the benchmark specification and is about 700 times faster than http://shootout.alioth.debian.org/gp4/benchmark.php?test=chameneos&lang=ocaml&id=0 I have used this approach to write my Schopenhauer software PLC in Ocaml. This is one of the key design factors for achieving realtime performance without hogging the CPU. Yet, what conclusion should I draw? Is the GNU/Debian/Linux-2.6 threading support creepingly slow, or does ocaml have an insurmountable aversion for threads? Alex -- ********************************************************************* Ing. Alessandro Baretta Studio Baretta http://studio.baretta.com/ Consulenza Tecnologica e Ingegneria Industriale Technological Consulting and Industrial Engineering tel. +39 02 370 111 55 fax. +39 02 370 111 54