Previous Table of Contents Next


Designating a Process Priority

Follow these steps to designate a process priority:

1.  Become superuser.
2.  Type priocntl -e -c class -m user-limit -p priority command-name and press Return. The -e option executes the command, the -c class option specifies the class. Default classes are TS (timesharing) or RT (real-time). The -m user-limit option specifies the maximum amount you can raise or lower your priority with the -p option. The -p priority command-name option enables you to specify the relative priority, in the RT class for a real-time thread. For a timesharing process, the -p option enables you to specify the user-supplied priority, which ranges from -20 to +20.
3.  While the process is running, in another shell, type ps -ecl | grep command-name and press Return.
4.  Review the output of the PRI column to verify that you have changed the process status successfully.

The following example starts the find command with the highest possible user-supplied priority:

castle% priocntl -e -c TS -m 20 -p 20 find / -name core -print
castle% ps -ecl | grep find
 8 S     0   632   528   TS  60 f5fa4b40   200 f5ff7ba0 pts/3  0:03 find
castle%

Changing the Scheduling Parameters of a Timeshare Process

Follow these steps to schedule the parameters of a timeshare process:

1.  Become superuser.
2.  Type priocntl -s -m user-limit [-p priority] -i id-type id-list and press Return. The -s option enables you to set the upper limit on the user priority range and change the current priority. The -m user-limit option specifies the maximum amount you can raise or lower your priority with the -p option. The -p priority command-name option enables you to designate a priority. The -i id-type and id-list option uses a combination of id-type and id-list to identify the process. The id-type specifies the type of ID, such as PID or UID.
3.  Type ps -ecl | grep id-list and press Return.
4.  Review the output of the PRI column to verify that you have changed the process status successfully.

The following example executes a command with a 500-millisecond time slice, a priority of 20 in the RT class, and a global priority of 120:

oak% priocntl -s -c RT -t 500 -p 20 myprog
oak% ps -ecl | grep myprog

Changing the Class of a Process

Follow these steps to change the class of a process:


NOTE:  You must be superuser or working in a real-time shell to change the class of a process from or to real-time.
1.  Become superuser.
2.  Type priocntl -s -c class -i id-type id-list and press Return. The -s option enables you to set the upper limit on the user priority range and change the current priority. The -c class option specifies the class, TS or RT, to which you are changing the process. The -i id-type and id-list options uses a combination of id-type and id-list to identify the process. The id-type specifies the type of ID, such as PID or UID.
3.  Type ps -ecl | grep id-list and press Return.
4.  Review the output of the PRI column to verify that you have changed the process status successfully.

The following example changes all the processes belonging to user 1001 to real-time processes:

# priocntl -s -c RT -i uid 1001
# ps -ecl | grep 1001
 8 S 1001  282  270  RT 100 f5e4c8a0  2392 f5d47806 ?      0:48 Xsun
 8 S 1001  311  301  RT 100 f5e6e1e8   471 f5d476ee ?      0:00 fbconsol
 8 S 1001  301  283  RT 100 f5e6db28   392 f5e6db98 ?      0:01 Xsession
 8 S 1001  349  346  RT 100 f5e6d468   256 f5e6d660 pts/2  0:00 csh
 8 S 1001  315    1  RT 100 f5e6cda8   982 f5d476c6 ?      0:00 speckeys
 8 S 1001  366  349  RT 100 f5e6c6e8  1410 f5d47586 pts/2  0:01 dtsessio
 8 S 1001  374  366  RT 100 f5e6c028  1814 f5d474be ??     0:24 dtterm
 8 S 1001  346  301  RT 100 f5ef38b0  1211 f5d47676 pts/2  0:00 sdt_shel
 8 S 1001  347    1  RT 100 f5ef31f0   478 f5d47626 ?      0:00 dsdm
 8 S 1001  365    1  RT 100 f5ef2470   903 f5d475d6 pts/2  0:01 ttsessio
 8 S 1001  375  366  RT 100 f5ef1db0  1702 f5d474e6 ?      0:03 dtfile
 8 S 1001  376  366  RT 100 f5ef16f0  1118 f5d4750e ?      0:01 snapshot
 8 S 1001  373  366  RT 100 f5ef1030  1710 f5d4755e ?      0:06 dtwm
 8 S 1001  393  374  RT 100 f5f468b8   253 f5f93386 pts/5  0:00 csh
 8 S 1001  378    1  RT 100 f5f461f8   385 f5f46268 ?      0:00 sdtvolch
 8 S 1001  405  375  RT 100 f5f45b38  1687 f5f76738 ?      0:00 dtfile
 8 S 1001  445  378  RT 100 f5f45478   193 f591aaf8 ?      0:00 cat
 8 S 1001  387  374  RT 100 f5f44db8   255 f5f44fb0 pts/3  0:00 csh
 8 S 1001  407  387  RT 100 f5f446f8  1140 f5d4732e pts/3  0:03 textedit
 8 S 1001  390  374  RT 100 f5f44038   252 f5f93986 pts/4  0:00 csh
 8 S 1001  417  393  RT 100 f5fa58c0   916 f5d472de pts/5  0:01 cmdtool
 8 S 1001  420  417  RT 100 f5fa5200   252 f5fc2b96 pts/6  0:00 csh
 8 S 1001  531  374  RT 100 f5fa4480   256 f5ff62a6 pts/7  0:00 csh
 8 S 1001  634  374  RT 100 f5fa3dc0   252 f5ff68a6 pts/8  0:00 csh
#


Previous Table of Contents Next