From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.7 required=5.0 tests=MAILTO_TO_SPAM_ADDR, SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id D24CFBC6C for ; Tue, 18 Dec 2007 16:57:21 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAACh8Z0fAXQInh2dsb2JhbACQAQEBAQgKKZlv X-IronPort-AV: E=Sophos;i="4.24,180,1196636400"; d="scan'208";a="5788046" Received: from concorde.inria.fr ([192.93.2.39]) by mail1-smtp-roc.national.inria.fr with ESMTP; 18 Dec 2007 16:57:22 +0100 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id lBIFvK9m002303 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 18 Dec 2007 16:57:21 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAABN9Z0dA6bjqkGdsb2JhbACQAQEBAQEHBAQJChEHmWo X-IronPort-AV: E=Sophos;i="4.24,180,1196636400"; d="scan'208";a="20469398" Received: from wr-out-0506.google.com ([64.233.184.234]) by mail4-smtp-sop.national.inria.fr with ESMTP; 18 Dec 2007 16:57:20 +0100 Received: by wr-out-0506.google.com with SMTP id c57so1600861wra.9 for ; Tue, 18 Dec 2007 07:57:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; bh=gh3kYXrCtavE5Ce2s0OP50+VhYxW8Y1x7i7LiUTV1sU=; b=WSxKjrNY5nDRFiJbWyBv6MxO4n/YeHd+W6jJBMs+KK1gjl0/mKq0i0A8e7MlqPWjdeYqh4nSX8h2DD23fTA26ChiCyxx2uQnFg2qDcp0dp3uiFoiatqkZZ1ps/sOTbAoe+LQ+XaC+qLqav/RBMKuwAj8up0ZPPJMN5h/+XeHcuU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=IcbAhGYBx3Z1LjVGE2XLPzl23Wtl2NNTA8b6ZaMJAuGYPdMROgrdsB5zynk8nQtyQ+v/RjrtvkenKsjuPvfnlDRATaD9tmcrVbnvXw553WmiwMCFvwXGi9iuW7jo61dOZnthaaDBTqXlfcaIBsFop0gh66WLLhTix17g6YE3UsU= Received: by 10.140.135.20 with SMTP id i20mr5057232rvd.146.1197993437703; Tue, 18 Dec 2007 07:57:17 -0800 (PST) Received: from ?192.168.0.7? ( [70.249.192.255]) by mx.google.com with ESMTPS id t20sm9639175rnf.2007.12.18.07.57.15 (version=SSLv3 cipher=RC4-MD5); Tue, 18 Dec 2007 07:57:16 -0800 (PST) Message-ID: <4767EDDA.2030302@gmail.com> Date: Tue, 18 Dec 2007 09:57:14 -0600 From: Edgar Friendly User-Agent: Thunderbird 2.0.0.9 (X11/20071031) MIME-Version: 1.0 To: Zheng Li Cc: caml-list@inria.fr Subject: Re: [Caml-list] Re: Problems spawning threads References: <4767582A.6020202@gmail.com> <87tzmg2rqh.fsf@pps.jussieu.fr> In-Reply-To: <87tzmg2rqh.fsf@pps.jussieu.fr> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 4767EDE0.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ccopts:01 ocaml:01 compiler:01 printf:01 iirc:01 edgar:98 edgar:98 hooked:98 threads:01 threads:01 wrote:01 caml-list:01 writes:01 native:03 native:03 Zheng Li wrote: > Hi, > > Edgar Friendly 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.