- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: pthread_create fails on HP-UX (64-bit) with er...
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
Discussions
Discussions
Discussions
Forums
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
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
тАО09-05-2007 08:49 PM
тАО09-05-2007 08:49 PM
I am using a client server program using RPC on HP-UX (Itanium), which uses pthread_create(). My program runs for a while but after sometime it fails with 11( i.e. lack of resources). I could not find what resources I lack. Then tuned kernel to max_thread_proc=512, still the problem remains.
note that I could run the programs 32-bit version on same machine without any problem but the 64-bit version shows the problem.
please let me know if anybody faced same problem or what are things to be checked to debug the problem.
Solved! Go to Solution.
- Tags:
- pthread
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-05-2007 10:11 PM
тАО09-05-2007 10:11 PM
Re: pthread_create fails on HP-UX (64-bit) with error code 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-05-2007 10:17 PM
тАО09-05-2007 10:17 PM
Re: pthread_create fails on HP-UX (64-bit) with error code 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-05-2007 10:45 PM
тАО09-05-2007 10:45 PM
Re: pthread_create fails on HP-UX (64-bit) with error code 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2007 12:40 AM
тАО09-07-2007 12:40 AM
Re: pthread_create fails on HP-UX (64-bit) with error code 11
I used following to compile the code
#cc +DD64 -lpthread -o thread thread.c
#include
#include
#include
#include
extern int errno;
static int count=0;
void *Start(void *a){
printf("I am a new thread [%d][%d]\n",count++,pthread_self());
while(1);
return NULL;
}
int main(){
pthread_t tid;
pthread_attr_t attr;
pthread_attr_init(&attr);
int rc;
while(1){
rc=pthread_attr_setstacksize(&attr,128*1024);
if(rc!=0){
perror("Thread stacksize failed ");
exit(1);
}
rc=pthread_create(&tid,&attr,Start,NULL);
if(rc!=0){
printf("errorno [%d], return code [%d]\n",errno,rc);
perror("Thread creation failed ");
exit(1);
}
// sleep(1);
};
return 0;
}
please let me know if this is a known issue with HPUX. where can I get list of all known issues and fixes for pthread in HPUX.
- Tags:
- bad html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2007 12:52 AM
тАО09-07-2007 12:52 AM
Solution> where can I get list of all known issues and fixes for pthread in HPUX.
That's easy; query the ITRC Patch Database. For example assuming release 11.23 (although you could be 11.31, I suppose) a search for 'pthread' shows a recent patch, PHCO_36323. See:
http://www1.itrc.hp.com/service/patch/search.do?BC=main|&pageOsid=hpux
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-07-2007 07:50 PM
тАО09-07-2007 07:50 PM
Re: pthread_create fails on HP-UX (64-bit) with error code 11
>#include
>extern int errno;
This is incorrect, replace by:
#include
>rc=pthread_attr_setstacksize(&attr,128*1024);
>if(rc!=0){
>perror("Thread stacksize failed ");
Might as well pull this out of the loop. Also perror won't work because the error returned is in rc.
>note here is that the stack is doubled than the default. If the stack remains default it creates thread till 512.
I'm confused. You're using 128 Kb, which is half the default of 256 Kb.
And if this is the issue, what is your maxdsiz and maxdsiz_64bit?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2007 04:52 PM
тАО09-09-2007 04:52 PM
Re: pthread_create fails on HP-UX (64-bit) with error code 11
Problem is still there I don't know what went wrong, problem is not consistent but intermittent. I checked maxdsize and maxdsize_64bit they are 1GB and 4GB respectively.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2007 10:19 PM
тАО09-09-2007 10:19 PM
Re: pthread_create fails on HP-UX (64-bit) with error code 11
Also, you shouldn't make the thread stack size smaller than the default.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-10-2007 06:20 PM
тАО09-10-2007 06:20 PM
Re: pthread_create fails on HP-UX (64-bit) with error code 11
But one thing is sure I keep on creating thread and canceling them in my program. The program is 64-bit. Can you please provide me version of your library?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-10-2007 06:40 PM - edited тАО09-24-2011 04:01 AM
тАО09-10-2007 06:40 PM - edited тАО09-24-2011 04:01 AM
Re: pthread_create fails on HP-UX (64-bit) with error code 11
>fails after creating lesser than these many number of threads.
How many?
>But one thing is sure I keep on creating thread and canceling them in my program.
Are you sure you want to cancel? Are your threads cancel safe? It may be better to let them finish, or put them in a pool that you can reuse.
>Can you please provide me version of your library?
PHCO_34944. The latest is PHCO_36323 and the recommended one is PHCO_35997.