Page 78 - DCAP103_Principle of operating system
P. 78
Unit 3: Process Management-II
However, even though each logical CPU runs slower when multiple threads (logical CPUs) are Notes
active, there is a greater total capacity. It is the same whether two active threads on a core or
more. The best throughput (transactions completed per second) occurs when all CPU hardware
threads are active.
3.3.6 Team Quest Model Reporting Changes
In a traditional single-threaded SMP CPU architecture, the Active Resource Statistic Service
Time is always equal to the Effective Service Time. Therefore, when there are not any other
bottlenecks in the system the CPU utilization will grow at a linear rate.
Figure 3.5 (a): Single-threaded Architecture Figure 3.5 (b): Multi-threaded Architecture
(a) (b)
This is no longer true with a multi-threading CPU architecture. When the CPU has more than
a minimal utilization, the Effective Service Time will sometimes be greater than the Service
Time. Figure 3.5(b) shows how multi-threading deviates from a traditional SMP straight line
trend line (Figure 3.5(a)).
In the case of this Solaris system using a Sun Ultra SPARC T1 processor with four threads per
core, the service time is indeed less than the effective service time. At low utilizations when
there is only one thread per core active, however, it is likely that the service time will equal the
effective service time and the utilization growth will be linear until more than one thread per
core is active but as the processor gets busier and more threads become active within the core,
effective service will get progressively larger than the service time and the utilization growth
will be larger than linear.
3.3.7 Context Switches and Mode Switches
Context switches can occur only in kernel mode. Kernel mode is a privileged mode of the CPU
in which only the kernel runs and which provides access to all memory locations and all other
system resources. Other programs, including applications, initially operate in user mode, but
they can run portions of the kernel code via system calls. A system call is a request in a like
operating system by an active process (i.e., a process currently progressing in the CPU) for a
service performed by the kernel, such as input/output (I/O) or process creation (i.e., creation of
a new process). I/O can be defined as any movement of information to or from the combination
of the CPU and main memory (i.e. RAM), that is, communication between this combination and
the computer’s users (e.g., via the keyboard or mouse), its storage devices (e.g., disk or tape
drives), or other computers.
The existence of these two modes in Unix-like operating systems means that a similar, but
simpler operation is necessary when a system call causes the CPU to shift to kernel mode.
This is referred to as a mode switch rather than a context switch, because it does not change
the current process.
Context switching is an essential feature of multitasking operating systems. A multitasking
operating system is one in which multiple processes execute on a single CPU seemingly
simultaneously and without interfering with each other. This illusion of concurrency is achieved
LOVELY PROFESSIONAL UNIVERSITY 71