Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Edgar Friendly <thelema314@gmail.com>
To: Zheng Li <li@pps.jussieu.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Re: Problems spawning threads
Date: Tue, 18 Dec 2007 09:57:14 -0600	[thread overview]
Message-ID: <4767EDDA.2030302@gmail.com> (raw)
In-Reply-To: <87tzmg2rqh.fsf@pps.jussieu.fr>

Zheng Li wrote:
> Hi,
> 
> Edgar Friendly <thelema314@gmail.com> writes:
>> Interestingly enough, the administrator reports that the code works with
>> size=16, but fails for size=17.  Any ideas what's going on or how to fix
>> it?  Hopefully I'll have some confirmation soon that the (probably
>> useless) ccopts and other optimization options don't affect the error.
> 
> OCaml native code compiler uses system thread which is heavy, so you
> shouldn't expect a large number of them running in parallel. In my box,
> 300+ threads will usually run out of virtual memory.
> 
My laptop does a just fine job making and using 503 native threads with
512M ram (and lots of big programs already filling that up).  I don't
believe that their (likely beefier) benchmarking system hits a VM limit
mine doesn't.

> n=16 works and n=17 doesn't, probably means the n=16 version finishes
> earlier so you haven't got chance to create enough threads to eat up
> your memory, while n=17 version last longer so that the limit is
> reached. You may try to add some printf to the thread creation function
> to monitor the upper bound.
> 
The code should create 503 threads and 503 channels hooked together in a
ring, and *then* it starts a message (a simple counter) going around the
ring until it's counted high enough (normal test goes to 20,000,000
iirc), and then the last task to get the message prints its position.
None of the threads finish while thread creation continues.

E.


  reply	other threads:[~2007-12-18 15:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-18  5:18 Edgar Friendly
2007-12-18  5:23 ` Edgar Friendly
2007-12-18  8:03 ` [Caml-list] " Michael Wohlwend
2007-12-18 10:59 ` Zheng Li
2007-12-18 15:57   ` Edgar Friendly [this message]
2007-12-18 17:05     ` Zheng Li
2007-12-18 17:40       ` [Caml-list] " Edgar Friendly
2007-12-18 16:22 ` [Caml-list] " Xavier Leroy
2007-12-18 17:04 ` Jon Harrop

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=4767EDDA.2030302@gmail.com \
    --to=thelema314@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=li@pps.jussieu.fr \
    /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