From: Zheng Li <li@pps.jussieu.fr>
To: caml-list@inria.fr
Subject: Re: Problems spawning threads
Date: Tue, 18 Dec 2007 11:59:34 +0100 [thread overview]
Message-ID: <87tzmg2rqh.fsf@pps.jussieu.fr> (raw)
In-Reply-To: <4767582A.6020202@gmail.com>
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.
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.
I don't know any workaround, in the absence of VM threads being able to
compile to native code (I asked a question on the topic once in the
beginner's list). Using user-land cooperative threads is probably
considered as cheating here.
--
Zheng Li
http://www.pps.jussieu.fr/~li
next prev parent reply other threads:[~2007-12-18 11:07 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 [this message]
2007-12-18 15:57 ` [Caml-list] " Edgar Friendly
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=87tzmg2rqh.fsf@pps.jussieu.fr \
--to=li@pps.jussieu.fr \
--cc=caml-list@inria.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