[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] pthread_attr_setstack() limitation



Paul Hartke wrote:

> Where does the default stack size come from for pthreads?  

./linuxthreads/internals.h:#define INITIAL_STACK_SIZE  (4 * __pagesize)

> What about the case where pthread_attr_setstack() isn't used?

in manager.c:pthread_allocate_stack(), you can see it all

if (attr!=NULL && attr->__stackaddr_set)
{
// Use user-provided stack, no size checking
}
else
{
  stacksize=INITIAL_STACK_SIZE;
  if(attr!=NULL)
     stacksize = attr->__stacksize;

...
  new_thread_bottom=malloc(stacksize);
...
}




John

> 
> Paul
> 
> Quoting Brettschneider Falk <fbrettschneider@xxxxxxxxxxxxxxxxx>:
> 
>>Hi,
>>as I was playing around to use an 8KB SRAM as stack via
>>pthread_attr_setstack() I saw there's a strange stacksize limitation in
>>the
>>pthread lib. I removed that locally, because a global search doesn't show
>>a
>>explanation that makes sense to me. Could it be changed in the official
>>CVS
>>tree as well? See the patch below.
>>Cheers, F@lk
>>
>>
>>
>>-----Original Message-----
>>From: cvs-robot@xxxxxxxxxxxxxxx: Monday, February 27, 2006 2:00 PM
>>Subject: CVS-notification
>>
>>
>>fbr committed:
>>uclinux_dist/uClibc/libc/sysdeps/linux/common/bits local_lim.h,1.3,1.4
>>
>>don't limit stacksize to 0x2000, but no minimum-limit
>>
>>
>>diffs:
>>===================================================================
>>RCS file:
>>
> 
> /repository1/uclinux_dist/uClibc/libc/sysdeps/linux/common/bits/local_lim.h,
> 
>>v
>>retrieving revision 1.3
>>retrieving revision 1.4
>>diff -r1.3 -r1.4
>>74c74
>>< #define PTHREAD_STACK_MIN	16384
>>---
>>
>>>#define PTHREAD_STACK_MIN	0x0
>>
> ___________________________
> microblaze-uclinux mailing list
> microblaze-uclinux@xxxxxxxxxxxxxx
> Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
> Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/


-- 
Dr John Williams, Research Fellow,
Embedded Systems Group / Reconfigurable Computing
School of ITEE, The University of Queensland, Brisbane, Australia
(p) +61 7 33652185  (f) +61 7 33654999 (m) +61 403969243
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/