caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: Markus Mottl <mottl@miss.wu-wien.ac.at>
Cc: OCAML <caml-list@inria.fr>
Subject: Re: [Caml-list] native threads not parallel?
Date: Fri, 15 Jun 2001 19:10:46 +0200	[thread overview]
Message-ID: <20010615191046.A20258@pauillac.inria.fr> (raw)
In-Reply-To: <20010615184931.A25835@miss.wu-wien.ac.at>; from mottl@miss.wu-wien.ac.at on Fri, Jun 15, 2001 at 06:49:32PM +0200

> 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>

   thr_setconcurrency(sysconf(_SC_NPROCESSORS_ONLN));

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: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


  reply	other threads:[~2001-06-15 17:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-06-15 16:49 Markus Mottl
2001-06-15 17:10 ` Xavier Leroy [this message]
2001-06-15 18:42   ` Markus Mottl
2001-06-15 21:33     ` Markus Mottl
2001-06-21 13:43       ` Markus Mottl
2003-02-20 23:10 Shivkumar Chandrasekaran
2003-02-21  0:15 ` Jacques Garrigue
2003-02-21  4:24   ` shivkumar chandrasekaran
2003-02-21 10:43     ` Markus Mottl
2003-02-21 15:11     ` Jacques Garrigue
2003-02-21 17:57       ` Markus Mottl
2003-02-24 17:39       ` Shivkumar Chandrasekaran
2003-02-21  0:32 ` Chris Uzdavinis
2003-02-21  1:56   ` james woodyatt
2003-02-21  4:43   ` shivkumar chandrasekaran

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010615191046.A20258@pauillac.inria.fr \
    --to=xavier.leroy@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=mottl@miss.wu-wien.ac.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).