Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Mar 2014 09:38:19 +0900
From:      David Chisnall <theraven@FreeBSD.org>
To:        =?iso-8859-1?Q?Roger_Pau_Monn=E9?= <roger.pau@citrix.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Too low PTHREAD_STACK_MIN value?
Message-ID:  <913B1E7A-5192-430F-ABAF-576DFCFF98E6@FreeBSD.org>
In-Reply-To: <531F42CD.8020307@citrix.com>
References:  <531F42CD.8020307@citrix.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 12 Mar 2014, at 02:07, Roger Pau Monn=E9 <roger.pau@citrix.com> =
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?913B1E7A-5192-430F-ABAF-576DFCFF98E6>