Sei sulla pagina 1di 4

J.E.D.I.

1 Solaris Process
1.1

Objectives

This chapter shows how a process is implemented in Solaris.

1.2

Chapter Outline

Introduction

Components of a process

Process Structure

1.3

Introduction

A process can be defined as a program in execution. As we discussed in our lecture class,


programs exist merely as instructions in a file until they are run by the CPU. When a program
is run, the instructions are loaded into main memory and thus becomes a process. This chapter
discusses how Solaris implements processes.

1.4

Components of a Process

The Solaris process follows our definition of a process. The operating system must keep track
of multiple processes coming from a user together with processes from other users at the
same time. Each Solaris process is given a process id (PID). A list of processes is stored in the
process table. The process table can be viewed with the ps command.
# ps -ef
UID
PID
root
0
root
1
root
2
root
3
root
215
root
7
root
9
root
124
root
101
/etc/snmp/conf
root 1840

PPID
0
0
0
0
1
1
1
1
1

C
0
0
0
0
0
0
0
0
0

STIME
Nov 20
Nov 20
Nov 20
Nov 20
Nov 20
Nov 20
Nov 20
Nov 20
Nov 20

TTY
?
?
?
?
?
?
?
?
?

1836

0 22:17:30 pts/2

TIME
0:11
0:02
0:00
11:05
0:00
0:13
0:28
0:26
0:00

CMD
sched
/sbin/init
pageout
fsflush
/usr/sbin/cron
/lib/svc/bin/svc.startd
/lib/svc/bin/svc.configd
/usr/sbin/nscd
/usr/lib/snmp/snmpdx -y -c

0:00 sh

A process can consist of multiple user threads. A thread is a line of code execution running
inside a process. A traditional process (such as a basic C or Java program) would have a single
thread running. But a Solaris process can support more than one thread running at the same
time. We will discuss how to program multithreaded applications in a later chapter.
Each user thread is associated by the Solaris kernel with a Light Weight Process or LWP. An
LWP allows each user thread to access kernel functions independently of other threads.
Each LWP is executed by a kernel thread. The kernel thread is the unit of synchronization in
Solaris. In essence, user threads, though the LWP construct, are executed by kernel threads.
To increase thread startup time, the kernel keeps idle kernel threads ready to accept LWPs
whenever a new user thread starts running.
Operating Systems

J.E.D.I.

Operating Systems

J.E.D.I.

1.5

Process Structure

Solaris stores information about each process in the system. The information stored is
summarized by the following figure. We will discuss each field in this section.

Source file information This field contains information on the executable file of this
process.

Memory information Indicates the memory pages where the process resides.

Process family tree pointer to the process that created this process (parent process)
or to child processes that this process has created.

Credentials indicates the user id and group id of the user that started the process.
This could be used to check against the security policy of the system.

CPU Utilization fields that keep track of the time the process runs, either in the usual
user mode, or running a kernel function in kernel mode.

Session processes are also grouped by sessions, for example, which processes belong
to which user terminals. This field is used to store information about the originating
session this process belongs to.

PID each process is given a unique process id number in the system.

Signal support signals are a way a process can be informed of a particular event, for
example, when the system is going to be shut down. This is a pointer to a structure
that indicates how signals are to be handled.

Open file list list of files that the process is currently using.

/proc support processes are represented in the file system as files in the directory

Operating Systems

J.E.D.I.

/proc, with the process file name as the process ID.

Process thread list a pointer to a structure that maintains the list of user threads that
make up the process.

Profiling information stores behavioral information about the process, such as


microstate accounting (low-level process state tracking), resource usage information.

Resource information stores information on which resources are used by the process
and what resources are made available to the process.

Operating Systems

Potrebbero piacerti anche