From owner-freebsd-current@FreeBSD.ORG Wed Mar 12 00:38:27 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84D08759 for ; Wed, 12 Mar 2014 00:38:27 +0000 (UTC) Received: from theravensnest.org (theraven.freebsd.your.org [216.14.102.27]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 55E0DA03 for ; Wed, 12 Mar 2014 00:38:26 +0000 (UTC) Received: from [172.16.1.25] (s224.GtokyoFL6.vectant.ne.jp [222.228.90.224]) (authenticated bits=0) by theravensnest.org (8.14.7/8.14.5) with ESMTP id s2C0cKjJ020991 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 12 Mar 2014 00:38:22 GMT (envelope-from theraven@FreeBSD.org) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: Too low PTHREAD_STACK_MIN value? From: David Chisnall In-Reply-To: <531F42CD.8020307@citrix.com> Date: Wed, 12 Mar 2014 09:38:19 +0900 Content-Transfer-Encoding: quoted-printable Message-Id: <913B1E7A-5192-430F-ABAF-576DFCFF98E6@FreeBSD.org> References: <531F42CD.8020307@citrix.com> To: =?iso-8859-1?Q?Roger_Pau_Monn=E9?= X-Mailer: Apple Mail (2.1874) Cc: freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Mar 2014 00:38:27 -0000 On 12 Mar 2014, at 02:07, Roger Pau Monn=E9 = wrote: > I've found out that the value PTHREAD_STACK_MIN is currently set (2048 > bytes) seems to be way too low This looks like an error in your code. The spec says: > PTHREAD_STACK_MIN > Minimum size in bytes of thread stack storage. > Minimum Acceptable Value: 0 It is meant to be the minimum value that the system can give for a = thread stack. The purpose of this constant is for languages that do = their own stack management bit some chain of activation records of = segmented stacks, but want to use pthreads for threading, so that they = can allocate the smallest possible stack that allows pthread cleanup to = work. =20 Using it from C code is very likely to be a mistake. David