Process, Priority, & Singnal concepts
A process is an instance of a running program. Processes have their own address space in memory, thread of execution, and characteristics such as security context, environment and current priority. The Linux kernel tracks every aspect of a process by its process ID number (or PID). Information about each process is advertised by the kernel to user programs through the /proc/PID directories.
When a process starts another program, the new program is called its child process. Child process can have their own children, and so on. When a parent process exits all of its descendant processes also exit.
Signals
The Operating system communicates to processes through signals. These signals report events or error situations to processes. One typical signal is SIGTERM, which terminates the process; it asks it to exit cleanly. Another is SIGKILL, which kills the process; the process is required to exit immediately.
Process scheduling
Only one process at a time may be executing per logical processing unit on its CPUs. Therefore, every process which is ready to run has a scheduling priority: a ranking among ready processes determine which should should get to run next.
The Linux process scheduler divides CPU time into time slices, in which each process will get a turn to run on a logical processing unit, higher priority first. The formula for calculating this priority is complex, but users can affect the priority by setting the niceness value for a process.
Niceness values range from -20 to +19, which indicates how much of a bonus or penalty to assign to the priority. Most processes run with a niceness value of 0 (no change). Smaller numbers are higher priority. Processes with a higher priority will run first in each time slice, and will run longer before its turn to run ends.
Note: carefully the effect of niceness. If all ready processes have the same priority, they will share the processor equally. priority only has an effect when two processes at different priority levels are competing for CPU time.
Monitor Processes by CPU or Memory Consumption
The GNOME System Monitor (gnome-system-monitor) is a utility which makes it easy to observe which processes are running on the system and what resources they are currently using. It also provides a means to terminate or kill processes and to adjust their current niceness values.
Q1. There is a process running on your system with the name process101. you will first adjust its nice value, then terminate the process, using System Monitor. Change the nice value of process101 to 7. Write down the steps you took to make that happen.
Ans. 1. launch System Monitor by selecting Application->System Tools->System Monitor.
2. Higlight the process in question.
3. Selecting Edit->Change Priority
4. Adjust the slider to the desired priority.
5. Click the Change Priority button.
6. Verify the priority in the Nice column.
Now terminate the process101
1. Launch System Monitor by selecting Application->System Tools->System Monitor.
2. Highlight the process in question.
3. Click the End Process button in the bottom-right corner.
4. If the process does not terminate.
A. Highlight the process.
B. Select Edit->Kill Process.
C. Click on the Kill Process button in the dialog box to confirm.
A process is an instance of a running program. Processes have their own address space in memory, thread of execution, and characteristics such as security context, environment and current priority. The Linux kernel tracks every aspect of a process by its process ID number (or PID). Information about each process is advertised by the kernel to user programs through the /proc/PID directories.
When a process starts another program, the new program is called its child process. Child process can have their own children, and so on. When a parent process exits all of its descendant processes also exit.
Signals
The Operating system communicates to processes through signals. These signals report events or error situations to processes. One typical signal is SIGTERM, which terminates the process; it asks it to exit cleanly. Another is SIGKILL, which kills the process; the process is required to exit immediately.
Process scheduling
Only one process at a time may be executing per logical processing unit on its CPUs. Therefore, every process which is ready to run has a scheduling priority: a ranking among ready processes determine which should should get to run next.
The Linux process scheduler divides CPU time into time slices, in which each process will get a turn to run on a logical processing unit, higher priority first. The formula for calculating this priority is complex, but users can affect the priority by setting the niceness value for a process.
Niceness values range from -20 to +19, which indicates how much of a bonus or penalty to assign to the priority. Most processes run with a niceness value of 0 (no change). Smaller numbers are higher priority. Processes with a higher priority will run first in each time slice, and will run longer before its turn to run ends.
Note: carefully the effect of niceness. If all ready processes have the same priority, they will share the processor equally. priority only has an effect when two processes at different priority levels are competing for CPU time.
Monitor Processes by CPU or Memory Consumption
The GNOME System Monitor (gnome-system-monitor) is a utility which makes it easy to observe which processes are running on the system and what resources they are currently using. It also provides a means to terminate or kill processes and to adjust their current niceness values.
Q1. There is a process running on your system with the name process101. you will first adjust its nice value, then terminate the process, using System Monitor. Change the nice value of process101 to 7. Write down the steps you took to make that happen.
Ans. 1. launch System Monitor by selecting Application->System Tools->System Monitor.
2. Higlight the process in question.
3. Selecting Edit->Change Priority
4. Adjust the slider to the desired priority.
5. Click the Change Priority button.
6. Verify the priority in the Nice column.
Now terminate the process101
1. Launch System Monitor by selecting Application->System Tools->System Monitor.
2. Highlight the process in question.
3. Click the End Process button in the bottom-right corner.
4. If the process does not terminate.
A. Highlight the process.
B. Select Edit->Kill Process.
C. Click on the Kill Process button in the dialog box to confirm.
Comments
Post a Comment