[prev in list] [next in list] [prev in thread] [next in thread] 

List:       hpux-devtools
Subject:    RE: HPUX-DEVTOOLS: Problem with scheduling
From:       "Ramnik Dahiya" <ramnik_dahiya () persistent ! co ! in>
Date:       2005-08-02 14:30:10
Message-ID: 200508021418.ADU21875 () persistent ! co ! in
[Download RAW message or body]

Thanks a lot , Andy !!

~Ramnik 

-----Original Message-----
From: Bennett, Andy (HP-UX Support) [mailto:andy.bennett@hp.com] 
Sent: Tuesday, August 02, 2005 7:01 PM
To: ramnik_dahiya@persistent.co.in; hpux-devtools@cxx.cup.hp.com
Subject: RE: HPUX-DEVTOOLS: Problem with scheduling 

Hi Ramnik,

I think the answer is you aren't going to get a proper definition in a
header file at 11.00 - which is what I am guessing you are currently using?
At 11i v1 the value is in sched.h, or more precisely
/usr/include/sys/sched.h has this:

enum __sched_policy {
        SCHED_INVALID = -1,
        SCHED_FIFO =     0,     /* Strict First-In/First-Out policy */
        SCHED_RR =       1,     /* FIFO, with a Round-Robin interval */
        SCHED_HPUX =     2,     /* the default HP-UX scheduling policy
*/
        /*
         * 3, 4 used by colliding DCE pthread interface
         */
        SCHED_RR2 =      5,     /* RR, with a per-priority RR interval
*/
        SCHED_RTPRIO =   6,     /* HP-UX rtprio(2) realtime scheduling
*/
        SCHED_NOCHANGE = 7,     /* used internally */
        SCHED_NOAGE =    8      /* HPUX without decay from usage */
};

So, 8 is the correct value.

Regards,
Andy.  



-----Original Message-----
From: Ramnik Dahiya [mailto:ramnik_dahiya@persistent.co.in]
Sent: 02 August 2005 13:10
To: Bennett, Andy (HP-UX Support); hpux-devtools@cxx.cup.hp.com
Subject: RE: HPUX-DEVTOOLS: Problem with scheduling 

Hi Andy,

Thanks for that :)It worked for me.  
However,as I said before the value of SCHED_NOAGE has been #define'd to
8 in our code and it is not present in sched.h .
Where can I find the exact definition of SCHED_NOAGE ?
I get the following from sched.h 

enum __sched_policy {
        SCHED_INVALID = -1,
        SCHED_FIFO =     0,     /* Strict First-In/First-Out policy */
        SCHED_RR =       1,     /* FIFO, with a Round-Robin interval */
        SCHED_HPUX =     2,     /* the default HP-UX scheduling policy
*/
        /*
         * 3, 4 used by colliding DCE pthread interface
         */
        SCHED_RR2 =      5,     /* RR, with a per-priority RR interval
*/
        SCHED_RTPRIO =   6,     /* HP-UX rtprio(2) realtime scheduling
*/
        SCHED_NOCHANGE = 7      /* used internally */
};

Is #define SCHED_NOAGE 8  correct ?

Regards,
~Ramnik



-----Original Message-----
From: owner-hpux-devtools@cxx.cup.hp.com
[mailto:owner-hpux-devtools@cxx.cup.hp.com] On Behalf Of Bennett, Andy
(HP-UX Support)
Sent: Tuesday, August 02, 2005 2:36 PM
To: ramnik_dahiya@persistent.co.in; hpux-devtools@cxx.cup.hp.com
Subject: RE: HPUX-DEVTOOLS: Problem with scheduling 

Hi,

Make sure the kernel knows about the priviledge groups. They don't
automatically get read by the kernel when you change the /etc/privgroup
file. For example:

# getprivgrp users
users: MLOCK
# cat > /etc/privgroup
users RTSCHED RTPRIO
# getprivgrp users
users: MLOCK
# setprivgrp -f /etc/privgroup
# getprivgrp users
users: RTPRIO RTSCHED
#

So, make sure the "getprivgrp" command shows the priviledges you want.

Regards,
Andy.

-----Original Message-----
From: owner-hpux-devtools@cxx.cup.hp.com
[mailto:owner-hpux-devtools@cxx.cup.hp.com] On Behalf Of Ramnik Dahiya
Sent: 02 August 2005 07:41
To: hpux-devtools@cxx.cup.hp.com
Subject: HPUX-DEVTOOLS: Problem with scheduling

Hi All,

I have the following piece of code to set maximum non-decaying scheduling
priority for a process.

//snip

int maxpri;
pid_t pid;
struct sched_param schedparam;

 /* get the maximum priority */
 maxpri = sched_get_priority_max(SCHED_NOAGE);
 schedparam.sched_priority = maxpri;
 pid = getpid();
 /* set the scheduler policy and the priority */  if (
(sched_setscheduler(pid , SCHED_NOAGE, &schedparam)) < 0 )  {
   cout<<"Error encountered :- "<<strerror(errno)<<"\n" ;
   exit (1);
 }
//snip
When I compile and run the program , I get the following error :-
"Privileges not enough".
Also, I checked /usr/include/sys/sched.h and there was no definition of
SCHED_NOAGE. However , SCHED_NOAGE has been #define'd to 8(legacy code).
The /etc/privgroup file contains the following entries against the name of
the user's group.
MLOCK RTSCHED RTPRIO.
Am I missing something here ?
Any pointers will be helpful.
Thanks,
~Ramnik
 _________________________________________________________________
 To leave this mailing list, send mail to majordomo@cxx.cup.hp.com
    with the message UNSUBSCRIBE hpux-devtools
_________________________________________________________________
 _________________________________________________________________
 To leave this mailing list, send mail to majordomo@cxx.cup.hp.com
    with the message UNSUBSCRIBE hpux-devtools
_________________________________________________________________
 _________________________________________________________________
 To leave this mailing list, send mail to majordomo@cxx.cup.hp.com
    with the message UNSUBSCRIBE hpux-devtools
 _________________________________________________________________
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic