- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Size of function stack in threads
Operating System - Linux
1753637
Members
5914
Online
108798
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-02-2005 02:08 AM
тАО12-02-2005 02:08 AM
Size of function stack in threads
Hi,
I have a C++ program running on HPUX 11. It uses Bison to create a parser. The parser function creates the parser stack as a local variable, the default size of the parser stack is about 300K. The program is connected to a message bus. When a message arives (a signal) a callback function calls the parser function.
One of the third-party libraries used to link the program was upgraded so that in order to relink the program I need to include the pthread library. The program itself has not changed and remeins a single thread program, but now linked with the multithread library pthread.
Since that the program chrashed regularly. So I changed size of the bison parser so that the local variable within the parser function has a size of about 5K, and the program runs now pretty stable.
My question: is there any additional limitation in the size of the function stack when using the pthread library?
Thanks in advance,
Miguel
I have a C++ program running on HPUX 11. It uses Bison to create a parser. The parser function creates the parser stack as a local variable, the default size of the parser stack is about 300K. The program is connected to a message bus. When a message arives (a signal) a callback function calls the parser function.
One of the third-party libraries used to link the program was upgraded so that in order to relink the program I need to include the pthread library. The program itself has not changed and remeins a single thread program, but now linked with the multithread library pthread.
Since that the program chrashed regularly. So I changed size of the bison parser so that the local variable within the parser function has a size of about 5K, and the program runs now pretty stable.
My question: is there any additional limitation in the size of the function stack when using the pthread library?
Thanks in advance,
Miguel
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-02-2005 02:18 AM
тАО12-02-2005 02:18 AM
Re: Size of function stack in threads
Hi Miguel:
You could reconfigure the kernel's 'maxdsiz' or 'maxdsiz_64bit' for 32-bit and 64-bit processes respectively. This would allow you to increase back the parser stack size.
See here fore more information:
http://docs.hp.com/en/TKP-90202/index.html
Regards!
...JRF...
You could reconfigure the kernel's 'maxdsiz' or 'maxdsiz_64bit' for 32-bit and 64-bit processes respectively. This would allow you to increase back the parser stack size.
See here fore more information:
http://docs.hp.com/en/TKP-90202/index.html
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-02-2005 03:59 AM
тАО12-02-2005 03:59 AM
Re: Size of function stack in threads
The best approach is to ask the box itself.
There are pthread_attr_getstacksize and pthread_attr_setstacksize functions. Man these functions for details.
I'm a little surprised that you knew to adjust this buffer to "fix" your problem. Have you done a stack trace to determine exactly what is going wrong?
Now, go find a hammer and hit yourself over the head. I have written many compilers, interpreters, parsers, and p-engines using yacc over the years and not once have I used a static buffer. Your buffer should be dynamically allocated and expand as it needs to. I'll bet your old 300K value was tremendous overkill and your new 5K is probably less than you may need.
There are pthread_attr_getstacksize and pthread_attr_setstacksize functions. Man these functions for details.
I'm a little surprised that you knew to adjust this buffer to "fix" your problem. Have you done a stack trace to determine exactly what is going wrong?
Now, go find a hammer and hit yourself over the head. I have written many compilers, interpreters, parsers, and p-engines using yacc over the years and not once have I used a static buffer. Your buffer should be dynamically allocated and expand as it needs to. I'll bet your old 300K value was tremendous overkill and your new 5K is probably less than you may need.
If it ain't broke, I can fix that.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP