System Administration Guide, Volume 2

Processes and System Performance

Terms related to processes are described in the table below.

Table 34-1 Process Terminology

Term 

Description 

Process  

An instance of program in execution.  

Lightweight process (LWP)  

Is a virtual CPU or execution resource. LWPs are scheduled by the kernel to use available CPU resources based on their scheduling class and priority. LWPs include a kernel thread, which contains information that has to be in memory all the time and an LWP, which contains information that is swappable. 

Application thread  

A series of instructions with a separate stack that can execute independently in a user's address space. They can be multiplexed on top of LWPs. 

A process can consist of multiple LWPs and multiple application threads. The kernel schedules a kernel-thread structure, which is the scheduling entity in the SunOS environment. Various process structures are described in the table below.

Table 34-2 Process Structures

Structure 

Description 

proc

Contains information that pertains to the whole process and has to be in main memory all the time. 

kthread

Contains information that pertains to one LWP and has to be in main memory all the time. 

user

Contains the per process information that is swappable. 

klwp

Contains the per LWP process information that is swappable. 

The figure below illustrates the relationship of these structures.

Figure 34-1 Process Structures

Graphic

Most process resources are accessible to all the threads in the process. Almost all process virtual memory is shared. A change in shared data by one thread is available to the other threads in the process.

Commands for Managing Processes

The table below describes commands for managing processes.

Table 34-3 Commands for Managing Processes

Use This Command ... 

To ... 

ps(1), pgrep(1), and prstat(1M)

Check the status of active processes on a system, as well as display detailed information about the processes 

dispadmin(1M)

List default scheduling policies 

priocntl(1)

Assign processes to a priority class and manage process priorities 

nice(1)

Change the priority of a timesharing process 

Another feature enables the control of process groups over processor sets. Using processor sets means process groups can bind to a group of processors rather than to just a single processor. The /usr/sbin/psrset command gives a system administrator control over the creation and management of processor sets. See psrset(1M) for more information.

See Chapter 35, Managing Processes (Tasks) for more information about commands for managing processes.