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
Multiprocessor support in OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-04-22 (07:42)
From: Jason Ganetsky <jason.ganetsky@g...>
Subject: Multiprocessor support in OCaml
Hi all,

I'm new to this list, and new to OCaml (although, have some experience with

Anyway, I have recently written an OCaml thread pool implementation, on top
of the Thread and Event modules. I did this for the purpose of exploiting an
SMP system I have, and was a disappointed to read today that OCaml doesn't
support multiprocessor systems.

I played around with it a little, and discovered that by liberally calling
Thread.yield, I do cajole my threads into running on multiple processors. Is
this behavior normal, or have I discovered a problem with the Thread module?
I'm certainly happy that I can get it to use my SMP... but I will stop it at
once if you tell me that this is unsafe.