JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Programming Interfaces Guide     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

1.  Memory and CPU Management

2.  Session Description Protocol API

3.  Process Scheduler

Overview of the Scheduler

Time-Sharing Class

System Class

Real-time Class

Interactive Class

Fair-Share Class

Fixed-Priority Class

Commands and Interfaces

priocntl Usage

priocntl Interface

Interactions With Other Interfaces

Kernel Processes

Using fork and exec

Using nice

init(1M)

Scheduling and System Performance

Process State Transition

4.  Locality Group APIs

5.  Input/Output Interfaces

6.  Interprocess Communication

7.  Socket Interfaces

8.  Programming With XTI and TLI

9.  Packet Filtering Hooks

10.  Transport Selection and Name-to-Address Mapping

11.  Real-time Programming and Administration

12.  The Oracle Solaris ABI and ABI Tools

A.  UNIX Domain Sockets

Index

Commands and Interfaces

The following figure illustrates the default process priorities.

Figure 3-1 Process Priorities (Programmer's View)

image:Real-time threads have priority over system threads. System threads have priority over time-sharing threads. Each class has a separate run queue.

A process priority has meaning only in the context of a scheduler class. You specify a process priority by specifying a class and a class-specific priority value. The class and class-specific value are mapped by the system into a global priority that the system uses to schedule processes.

A system administrator's view of priorities is different from the view of a user or programmer. When configuring scheduler classes, an administrator deals directly with global priorities. The system maps priorities supplied by users into these global priorities. See Oracle Solaris Administration: Common Tasks for more information about priorities.

The ps(1) command with -cel options reports global priorities for all active processes. The priocntl(1) command reports the class-specific priorities that users and programmers use.

The priocntl(1) command and the priocntl(2) and priocntlset(2) interfaces are used to set or retrieve scheduler parameters for processes. Setting priorities generally follows the same sequence for the command and both interfaces:

  1. Specify the target processes.

  2. Specify the scheduler parameters that you want for those processes.

  3. Execute the command or interface to set the parameters for the processes.

Process IDs are basic properties of UNIX processes. See Intro(2) for more information. The class ID is the scheduler class of the process. priocntl(2) works only for the time-sharing and the real-time classes, not for the system class.

priocntl Usage

The priocntl(1) utility performs four different control interfaces on the scheduling of a process:

priocntl -l

Displays configuration information

priocntl -d

Displays the scheduling parameters of processes

priocntl -s

Sets the scheduling parameters of processes

priocntl -e

Executes a command with the specified scheduling parameters

The following examples demonstrate the use of priocntl(1).

priocntl(1) includes the interface of nice(1). nice works only on time-sharing processes and uses higher numbers to assign lower priorities. The previous example is equivalent to using nice(1) to set an increment of 10:

$ nice -10 make bigprog

priocntl Interface

priocntl(2) manages the scheduling parameters of a process or set of processes. An invocation of priocntl(2) can act on a LWP, on a single process, or on a group of processes. A group of processes can be identified by parent process, process group, session, user, group, class, or all active processes. For more details, see the priocntl man page.

The PC_GETCLINFO command gets a scheduler class name and parameters when given the class ID. This command enables you to write programs that make no assumptions about what classes are configured.

The PC_SETXPARMS command sets the scheduler class and parameters of a set of processes. The idtype and id input arguments specify the processes to be changed.