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
[Caml-list] native threads not parallel?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-06-15 (17:10)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: [Caml-list] native threads not parallel?
> I am having problems using native threads (under Solaris; don't know
> about other architectures): I can't get them to run in parallel on a
> dual-processor machine even though I turn off the master lock on the
> C-side around an external function that should execute in parallel.

The default thread library under Solaris is odd in the sense that, by
default, it doesn't take advantage of more than one processor.  (More
specifically, it creates only one "ligthweight process", i.e. kernel
thread, unless more are required for I/O purposes.)  Try to put the
following incantation somewhere in your code:

#include <thread.h>
#include <unistd.h>


If that doesn't help, you might still want to look at how many LWPs
(not user threads) are active in your program, using whatever tools
Solaris provides for this purpose.  

- Xavier Leroy
Bug reports:  FAQ:
To unsubscribe, mail  Archives: