![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Pthread_create issue | Hellboy | High Level Programming | 1 | 05-19-2008 03:58 AM |
| How Can I use pthread_create ? | shvalb | High Level Programming | 5 | 03-11-2008 10:17 AM |
| pthread_create and scope usage | jenmead | High Level Programming | 3 | 09-20-2006 01:16 PM |
| unresolve pthread_create etc | zhshqzyc | High Level Programming | 3 | 02-13-2006 03:38 PM |
| pthread_create problem | _rocky | High Level Programming | 5 | 03-11-2005 03:38 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
pthread_create fails when used with pthread_attr_setinheritsched() on HPUX
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_EXPLICIT_SCHED); . . . thret = pthread_create(&sthread,&serv_attr,server_main, 0); but if i remove this line thret = pthread_attr_setinheritsched(&serv_attr,PTHREAD_EXPLICIT_SCHED); it works fine, can anyone suggest whats happening here. I have tried the same on AIX and Solaris, it works there. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
I have never played with the scheduling calls on any unix, but I will make a guess. Look at the man page for rtsched() and notice the following routines:
sched_get_priority_max() sched_get_priority_min() PRI_HPUX_TO_POSIX() PRI_POSIX_TO_HPUX() My guess is that some combination of these routines is needed. Priorities on HP-UX are backwards. Or reversed. Or mirror-imaged. Or something like that. Anyway, it looks like a landmine waiting to be stepped on: Quote:
|
|
#3
|
|||
|
|||
|
NAME
rtsched - execute process with real-time priority SYNOPSIS rtsched -s scheduler -p priority command [arguments] rtsched [ -s scheduler ] -p priority -P pid DESCRIPTION Rtsched executes command with POSIX or HP-UX real-time priority, or changes the real-time priority of currently executing process pid. ---------------------------------------------------------------------------- this is what I found when I checked the man page of the rtsched. This basically tells about the process scheduling on HP-UX. And my program illustrated above only playing with the standard pthreads. Can you put more focus on this. I did not get what you wanted to suggest. Please respond and correct me if I am wrong here. |
|
#4
|
||||
|
||||
|
Your man page must be truncated somehow. Mine has a lot more than you quote. This includes descriptions of the functions I mentioned and that quote I have above came from the man page as well. Try this copy rtsched(2).
|
||||
| Google The UNIX and Linux Forums |
| Thread Tools | |
| Display Modes | |
|
|