This is a discussion on pthread_create fails when used with pthread_attr_setinheritsched() on HPUX within the HP-UX Operating System forums, part of the Unix Operating Systems category; --> I am using HPUX on Itanium and I have c program where I am doing something like this but ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I am using HPUX on Itanium and I have c program where I am doing something like this but this pthread_create always fails at runtime prio = PRI_MAX; prio_low = PRI_MIN; .. .. .. .. struct sched_param sched_param={1}; sched_param.sched_priority=prio; thret = pthread_attr_setschedparam(&serv_attr, &sched_param); thret = pthread_attr_setinheritsched(&serv_attr,PTHREAD_EX PLICIT_SCHED); .. .. .. thret = pthread_create(&sthread,&serv_attr,server_main, 0); but if i remove this line thret = pthread_attr_setinheritsched(&serv_attr,PTHREAD_EX PLICIT_SCHED); it works fine, can anyone suggest whats happening here. I have tried the same on AIX and Solaris, it works there. |
| |||
| abhijeet.bhattacharya@gmail.com wrote: > I am using HPUX on Itanium and I have c program where I am doing > something like this > but this pthread_create always fails at runtime > prio = PRI_MAX; > prio_low = PRI_MIN; > . > . > . > . > struct sched_param sched_param={1}; > sched_param.sched_priority=prio; > thret = pthread_attr_setschedparam(&serv_attr, &sched_param); > thret = > pthread_attr_setinheritsched(&serv_attr,PTHREAD_EX PLICIT_SCHED); > . > . > . > thret = pthread_create(&sthread,&serv_attr,server_main, 0); > but if i remove this line > thret = > pthread_attr_setinheritsched(&serv_attr,PTHREAD_EX PLICIT_SCHED); > it works fine, can anyone suggest whats happening here. I have tried > the same on AIX and Solaris, it works there. Are you checking the return status on the call to make sure it succeded? If it failed, perhaps the serv_attr isn't in a usable state and that triggers the pthread_create failure. What is the specific error return from pthread_create? I know it is a tired, old song and dance, but have you checked the various manpages on HP-UX for those calls? rick jones -- denial, anger, bargaining, depression, acceptance, rebirth... where do you want to be today? these opinions are mine, all mine; HP might not want them anyway... feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH... |
| ||||
| abhijeet wrote: : I am using HPUX on Itanium and I have C program where I am doing : something like this but this pthread_create always fails at runtime : struct sched_param sched_param={1}; This was also submitted on the ITRC: http://forums1.itrc.hp.com/service/f...readId=1090167 I tracked this down to the value 1. It has to be in the range: Min pri: -256, max pri: -129 And only by root. |
| Thread Tools | |
| Display Modes | |
|
|