LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Default stack size on Linux/glibc/pthreads? (https://www.linuxquestions.org/questions/linux-newbie-8/default-stack-size-on-linux-glibc-pthreads-358438/)

rameshnj 08-30-2005 07:44 AM

Default stack size on Linux/glibc/pthreads?
 
Can someone please tell us what is the default stack size on Linux/glibc/pthreads(NPTL Pthreads library) ?

freakyg 08-31-2005 09:32 PM

hmm, 4k I guess.......

foo_bar_foo 09-01-2005 01:26 AM

you can/should set it with pthread_attr_setstacksize
but
Code:

#include <pthread.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
  size_t stacksize;
  pthread_attr_t attr;
  pthread_attr_init(&attr);
  pthread_attr_getstacksize (&attr, &stacksize);
  printf("Default stack size = %d\n", stacksize);
 
}

(gary) ~/clean $ gcc -o stacksize stacksize.c -lpthread
(02:17am:09/01/05)
(gary) ~/clean $ ./stacksize
Default stack size = 8388608

that's what 8 MB or 8192 KB right ? somebody help me out

balainemb 11-03-2009 02:55 AM

Quote:

Originally Posted by foo_bar_foo (Post 1830239)
you can/should set it with pthread_attr_setstacksize
but
Code:

#include <pthread.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
  size_t stacksize;
  pthread_attr_t attr;
  pthread_attr_init(&attr);
  pthread_attr_getstacksize (&attr, &stacksize);
  printf("Default stack size = %d\n", stacksize);
 
}

(gary) ~/clean $ gcc -o stacksize stacksize.c -lpthread
(02:17am:09/01/05)
(gary) ~/clean $ ./stacksize
Default stack size = 8388608

that's what 8 MB or 8192 KB right ? somebody help me out

right !!!


All times are GMT -5. The time now is 08:51 PM.