- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: POSIX stacksize and PA-RISC
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
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
Community
Resources
Forums
Blogs
- 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
03-19-2007 01:39 AM
03-19-2007 01:39 AM
One of my threaded application is getting bus error because of the lower stack size of thread on PA machines. The application works fine for IA systems. I wanted to know why it is limited to 64 K on PA and is there any way to tune this value without using pthread() calls ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2007 01:54 AM
03-19-2007 01:54 AM
Re: POSIX stacksize and PA-RISC
What I've seen says ptthread is needed.
http://docs.hp.com/en/B2355-60105/pthread_attr_getdetachstate.3T.html
I would think that HP-UX 11i v2 would have the same stack size on PA-RISC as IA. Perhaps this issue is due to OS differences. 11.11 is older and may not have anticipated the needs of todays newer applications.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2007 05:24 AM
03-19-2007 05:24 AM
Re: POSIX stacksize and PA-RISC
+++++++++++++++++++++++++++++++++++++++++
#include
#include
#include
#include
#include
int* owner=NULL;
void* proc_monthread1(void*);
int main()
{
pthread_t odd_thread;
pthread_t even_thread;
pthread_attr_init(&odd_thread);
if ( pthread_create(&odd_thread, NULL,proc_monthread1, (void *)NULL) != 0 )
{
perror("");
exit(1);
}
sleep(600);
return 0;
}
void* proc_monthread1(void* arg)
{
char buff[1024*64];
char buff1[1024];
int i=0;
while (i++ < 25)
{
printf("I am thread 1\n");
sleep(1);
}
return NULL;
}
++++++++++++++++++++++++++++++++++++++++++++
Any answers to this ?
Compilation done using:
#cc thread_stack.c -g -o thre_pa -lpthread
ldd:
# ldd thre_pa
/usr/lib/libc.2 => /usr/lib/libc.2 /usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libc.2 => /usr/lib/libc.2 /usr/lib/libpthread.1 =>/usr/lib/libpthread.1
If I remove, 'buff' from thread, I know it works fine. Why do HP-UX PA-RISC comes with default stack size 64K which is not at all sufficient for even a very lightweight threaded application ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2007 11:25 AM
03-19-2007 11:25 AM
Re: POSIX stacksize and PA-RISC
I've heard a newer libpthread patch will allow you to set an environment variable to increase the default. You can also use pthread_default_stacksize_np to set the default.
>SEP: 11.11 is older and may not have anticipated the needs of todays newer applications.
The man page for 11.31 still says 64 Kb.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2007 05:49 PM
03-19-2007 05:49 PM
Re: POSIX stacksize and PA-RISC
Dennis,
Can you please inform me about the libpthread patch for 11i v2 ? Since our application is already shipped to customer and to fix this we need to optimize our code to put all buffer on heap, we would like to inform customer about this patch and environment variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2007 07:25 PM
03-19-2007 07:25 PM
SolutionIt appears this patch has been out for some time. For 11.23 it is CR JAGaf63003, PHCO_34718. The variable is PTHREAD_DEFAULT_STACK_SIZE.
>to fix this we need to optimize our code to put all buffer on heap
You could always use pthread_default_stacksize_np or pthread_attr_setstacksize rather than putting all buffers on the heap.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2007 09:36 PM
03-19-2007 09:36 PM
Re: POSIX stacksize and PA-RISC
I have applied the patch and it is working with environment variable. We do not want to fix this with "setstacksize()" as this is required for larger portion of the application. Its okay if it works with some patch and setting environment variable.
I will close the thread. Thanks a bunch again for your response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-19-2007 09:38 PM
03-19-2007 09:38 PM