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.3 required=5.0 tests=AWL,MAILTO_TO_SPAM_ADDR, SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 44192BC69 for ; Tue, 18 Dec 2007 18:40:56 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAIOUZ0fRVca6kmdsb2JhbACQAQEBAQEHAgYJChaBFphU X-IronPort-AV: E=Sophos;i="4.24,181,1196636400"; d="scan'208";a="20474064" Received: from concorde.inria.fr ([192.93.2.39]) by mail4-smtp-sop.national.inria.fr with ESMTP; 18 Dec 2007 18:40:56 +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 lBIHetVe006654 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Tue, 18 Dec 2007 18:40:55 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAIOUZ0fRVca6kmdsb2JhbACQAQEBAQEHAgYJChaBFphU X-IronPort-AV: E=Sophos;i="4.24,181,1196636400"; d="scan'208";a="20474060" Received: from rv-out-0910.google.com ([209.85.198.186]) by mail4-smtp-sop.national.inria.fr with ESMTP; 18 Dec 2007 18:40:52 +0100 Received: by rv-out-0910.google.com with SMTP id f5so2175483rvb.57 for ; Tue, 18 Dec 2007 09:40:50 -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=ykawZnZJ1M8BYaPhoDOt+6JocMfLApyH5hD1C3/O+DI=; b=cuk3O/9P+mSt0wUNI9UCLFz9577hdZQNANketTRc8yEeG6qkNTMSHmp44Y+WYXvmftBLVFChoz/Vw0eTweXH6VlCHjw069Ol1VNOrEiat8BI0xWENasG+DgvH4pegYyQXcDRbONshZEg1CtQdpyq4BpcJx2meFzbNgwa6mKvQH8= 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=A+ztbk+avZL5atWm0aEtjFgWPik8hsHziuEMAKdPTdG4KcvoMPl3y6MFu52FskgryyBM+Ab5XNXNXxUhTPKIb1rCMx7tdHtxmS0o+Etx+V1c/tq6UHMfRumUNaWCXkBav2m1D77h3bgQZ5gg1Me3yBSTFfT09NBepVfuYeUfzzc= Received: by 10.140.147.18 with SMTP id u18mr207972rvd.267.1197999650906; Tue, 18 Dec 2007 09:40:50 -0800 (PST) Received: from ?192.168.0.7? ( [70.249.192.255]) by mx.google.com with ESMTPS id t20sm9843136rnf.2007.12.18.09.40.48 (version=SSLv3 cipher=RC4-MD5); Tue, 18 Dec 2007 09:40:49 -0800 (PST) Message-ID: <4768061F.7080404@gmail.com> Date: Tue, 18 Dec 2007 11:40:47 -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> <4767EDDA.2030302@gmail.com> <878x3s3pdn.fsf@pps.jussieu.fr> In-Reply-To: <878x3s3pdn.fsf@pps.jussieu.fr> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 47680627.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; makefile:01 emacs:01 c-c:01 c-c:01 hmmm:01 ulimit:01 ulimit:01 ocaml:01 ocaml:01 emacs:01 xavier's:01 edgar:98 edgar:98 threads:01 threads:01 Zheng Li wrote: > Hi > > Edgar Friendly writes: >> 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. > Just made a test, the upper bound of my machine is 381 threads (without > event sync, just start threads and hold). You probably have to wrap some > C function to set pthread's stack size to ~ PTHREAD_STACK_MIN. > Okay, now things get really wierd... I use a Makefile to build and execute the test benchmark, and I run make from Emacs using tuareg's C-c C-c macro. When I do so, I have no problems running the test - it just takes a while to complete. But if I run the same make command from my bash prompt inside gnome-terminal, I get the "Thread.create: Cannot allocate memory" error... hmmm... Maybe there really is something to this ulimit deal... [root@iesyou shootout]# ulimit -s 1000 [root@iesyou shootout]# ./threadring.ocaml_run.opt 10000 444 [root@iesyou shootout]# ulimit -s 10000 [root@iesyou shootout]# ./threadring.ocaml_run.opt 10000 Fatal error: exception Sys_error("Thread.create: Cannot allocate memory") I wonder what stack size gets inherited from emacs... Anyway, this looks like confirmation of Xavier's theory. Thanks everyone. E.