PROCESSOR THREADING AND MULTI-CORE ARCHITECTURE
A computer contains three layers of threading: user-level threads, kernel-level threads, and hardware threads.
User-Level Threads
User-level threads are created and managed in the application software.
Kernel-Level Threads
A computer's operating system kernel creates a thread object for each user-level thread, and manages the scheduling of the execution of these threads.
Hardware Threads
A single core in the computer's processor can execute two kernel-level threads through sharing most of the execution resources.
Single Threading
In the early days of computing, PCs could only run one program at a time.
The basic unit of scheduling is the thread. A program with only one thread would run on one processor at a time. Different tasks of the program will run one after the other.
For example, making tea and reading a book.
• Task 1: Open the cupboard, take out a tea kettle, put in the water, turn on the stove, boil the water, put tea in the tea pot, steep, pour into cup, drink.
• Task 2: Pick out a book, open the book, then begin reading.
All work is done sequentially—Task 1 has to execute first, then Task 2 executes when Task 1 is completed.
Multi-Programming Execution
Processors with a single core could execute more than one program by alternately processing a few steps from each active program. By rapidly switching between programs, the execution would simulate parallel execution, known as concurrent execution.
For example, selecting a book while waiting for the water to boil for tea.
Multiple Threads and the Hardware Abstraction Layer
Intel® Hyper-Threading Technology1 (Intel® HT Technology) makes a single processor appear—from the software's perspective—as multiple logical processors. This allows the operating system and applications to schedule multiple threads to logical processors as they would on multiprocessor systems.
Intel HT Technology interleaves the instructions in the execution pipeline. The instructions executed depend on the resources available.
What is multi-core processor architecture?
2 cores and 4 threads
• A multi-core processor has two or more cores within a single processor package.
• With multiple cores, a sequence of instructions or thread can have a hardware execution environment entirely to itself.
• Threads do not have to wait for any one resource. Threads run independently on separate cores.
Example:
Intel® Core™ M-5Y70 processor
2 Cores / 4 Threads
1.10 GHz per clock cycle
4 cores and 8 threads
• If an application has been written using threads, multi-core processors can run those threads in separate cores in parallel, thereby completing the application in much less time.
Example:
Intel® Core™ i7-4910MQ processor
4 Cores / 8 Threads
2.90 GHz per clock cycle
Threads provide many benefits.
• Multiple threads can help achieve better throughput even on single-processor systems.
• Threads are useful in applications with graphical user interface (GUI) applications.
• Using threads to process different parts of the software with GUI (drawing, input, computing, etc.) will improve the responsiveness of the software.
• Programs with multiple active threads can execute in parallel in multiple processors, increasing system performance.
• This process, for example, is like reading a book while waiting for water to boil, rather than waiting for water to boil before starting to read a book—it’s all done simultaneously.