LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 08-30-2005, 07:44 AM   #1
rameshnj
LQ Newbie
 
Registered: Aug 2005
Posts: 1

Rep: Reputation: 0
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) ?
 
Old 08-31-2005, 09:32 PM   #2
freakyg
Member
 
Registered: Apr 2005
Distribution: LFS 5.0 and 6.1
Posts: 705

Rep: Reputation: 30
hmm, 4k I guess.......
 
Old 09-01-2005, 01:26 AM   #3
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 51
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

Last edited by foo_bar_foo; 09-01-2005 at 01:30 AM.
 
Old 11-03-2009, 02:55 AM   #4
balainemb
LQ Newbie
 
Registered: Oct 2009
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by foo_bar_foo View Post
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 !!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FC4 - new stack size? DJOtaku Fedora 2 10-07-2005 12:22 PM
glibc 2.3.4 and pthreads DrTodd Linux - Software 2 04-26-2005 12:13 PM
2052 stack size is not enough! - glibc problem Yerp Linux From Scratch 2 12-26-2004 03:12 PM
Recompile glibc with larger stack size? insectile Slackware 3 07-20-2004 12:34 PM
pthreads stack frame lock up detection flakjacket Linux - General 0 06-26-2004 11:19 AM


All times are GMT -5. The time now is 04:57 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration