Presentation is loading. Please wait.

Presentation is loading. Please wait.

Presentation 31 – Multicore, Multiprocessing, Multithreading, and Multitasking. When discussing modern PCs, the term “Multi” is thrown around a lot as.

Similar presentations


Presentation on theme: "Presentation 31 – Multicore, Multiprocessing, Multithreading, and Multitasking. When discussing modern PCs, the term “Multi” is thrown around a lot as."— Presentation transcript:

1 Presentation 31 – Multicore, Multiprocessing, Multithreading, and Multitasking.
When discussing modern PCs, the term “Multi” is thrown around a lot as in: Multicore, Multiprocessing, Multithreading, and Multitasking. In today’s presentation we will attempt to sort all this out so that you can understand each of these important concepts.

2 At the end of this presentation, you will be able to:
Objectives At the end of this presentation, you will be able to: At the end of today’s presentation, you should be able to:

3 Explain the difference between multitasking and multiprocessing.
Explain the difference between multithreading and multiprocessing. List several disadvantages of achieving multiprocessing by using multiple MPU packages. Explain the difference between cooperative and preemptive multitasking. Explain the difference between symmetrical and asymmetrical multiprocessing. Discuss the internal structure of the Pentium D, Core 2 Duo, and Core 2 Quad microprocessors. Explain the difference between multitasking and multiprocessing. Explain the difference between multithreading and multiprocessing. List several disadvantages of achieving multiprocessing by using multiple MPU packages. Explain the difference between cooperative and preemptive multitasking. Explain the difference between symmetrical and asymmetrical multiprocessing. Discuss the internal structure of the Pentium D, Core 2 Duo, and Core 2 Quad microprocessors.

4 “Multi” — More than what?
Multitasking Multithreaded Multiprocessing Multicore Obviously, “Multi” means more than one. But the term is used so many different ways when discussing PCs that it often helps to stop and ask: “More than one what?” In the world of personal computers, the four most popular terms starting with the “multi” prefix are: Multitasking, Multithreading, multiprocessing, and multicore. Let’s take each of these terms one at a time and be sure we understand what they mean.

5 Multitasking The apparent simultaneous execution of two or more programs by a single processor. What appears to be simultaneous execution is actually concurrent execution. Dates back to the earlier days of Windows. Multitasking can be defined as the apparent simultaneous execution of two or more programs by a single processor. The key word here is “apparent.” What appears to be simultaneous execution is actually concurrent execution. That is, the processor works on one program for an instant and the next program in the next instant. Because the processor is so fast it appears to be executing both programs simultaneously. Multitasking dates back to the earlier days of Windows.

6 Think of Multitasking this way.
Program 1 Processor This diagram may help you to visualize the nature of multitasking. It is as if the processor were constantly switching back and forth between the twp programs. That is, the processor executes instructions from Program 1 for a moment and then switches to Program 2 for the next moment. Generally, this speeds the overall process because one program does not have to wait for the other to finish. Program 2

7 Two types of Multitasking
Cooperative Preemptive Two different forms of Multitasking are popular: Cooperative multitasking and Preemptive multitasking.

8 Cooperative Multitasking
Program 1 Processor The Applications control the switching. With cooperative multitasking, the operating system (OS) transfers control to the programs themselves and the programs determine when the switching occurs. When Program 1 has control, Program 2 can not run until Program 1 gives up control. Obviously then, the two programs must cooperate if they are to share the single processor. Early versions of Windows used this approach. Program 2

9 Preemptive Multitasking
Program 1 Processor With preemptive multitasking, the operating system (OS) controls the switching. That is, the OS executes each program in turn for a specific period of time, although the program being executed can give up control before it allotted time is up. Later versions of Windows use this approach. Program 2 The operating system control the switching.

10 Multitasking Program 1 Processor Program 2
The important points to remember about Multitasking is that two (or more) programs are executed concurrently. Think of their functions as being chopped up, with the pieces being executed alternately one after another. Program 2

11 Multithreaded A single Program or Application can be written so that it can be executed as two or more “threads” of instructions. A “thread” can be thought of as a stand alone task. For example, in a video processing application the video information could be processed as one thread; the audio as another. Somewhat similar to Multitasking is a different concept called Multithreading. A single program or application can be written so that it can be executed as two or more “threads” of instructions. A “thread” can be thought of as a stand alone task. For example, in a video processing application the video information could be processed as one thread; the audio as another. If the application is written this way, it is said to be multithreaded.

12 Think of Multithreading this way.
Processor Application This diagram may help you to visualize multithreading. Here a single application has been written so that it has two threads. It is as if the processor were constantly switching back and forth between the two threads. That is, the processor executes instructions from Thread 1 for a moment and then switches to Thread 2 for the next moment. Generally, this speeds the overall application because one thread does not have to wait for the other to finish. Thread 2

13 Multithreading a Video Processing Application
Processor Video Video Audio Perhaps this somewhat over simplified example will illustrate the process. Here a single video processing program of some kind has split the video function and the audio function into separate threads. The processor switches back and forth between the two threads executing a block of instructions from one thread before switching to the other. By switching back and forth between the two threads very quickly, the processor can keep the video and audio in sync while processing each separately. Thread 2 Audio

14 Threads Threads occur within a single application.
The application must be written for Multithreading. Not all applications lend themselves to this form of parallelization. The processor must support multithreading. Not all processors do. Here are some final thoughts on multithreading. Threads occur within a single application. The application must be written for multithreading. Not all applications lend themselves to this form of parallelization. Also, the processor must be able to handle multithreading. Not all processors do.

15 Pentium 4 was optimized for multithreading.
Logical Core 1 Thread 1 Thread 1 Thread 2 Thread 1 Logical Core 2 Thread 2 While multithreading has been around for a long time, the Intel optimized its Pentium 4 to take full advantage of multithreading. They called it Hyperthreading. The Pentium 4’s processing function can be divided between two threads in such a way that it appears to have two processing cores. In the Pentium 4, these were referred to as logical cores. The two cores were only an illusion created by clever design. But it did not remain an illusion for long. Pentium 4

16 Pentium D Pentium 4 Pentium 4
In 2005 Intel introduced the first true dual-core CPU, which it called Pentium D. Originally introduced as essentially two Pentium 4 dies in a single package, it was soon upgraded to dual Pentium 4 cores on a single die. It allows a PC to run two different applications (entirely separate programs) simultaneously. Also, it allows two different users to access the same PC simultaneously, which was not possible with earlier processors. It required a new chipset that supports dual core operation and works best with applications written specifically for dual core. Pentium 4

17 Multiprocessing A single computer runs two (or more) separate programs at the same time. Servers and workstations achieved this by using multiple processors in separate packages. PCs achieve this by using multiple cores in a single package. This ability to run two programs simultaneously is called multiprocessing. The concept of multiprocessing has been around for years, but has been confined to servers and high end workstations. In the past multiprocessing could only be achieved by using multiple CPU packages. By placing two processing cores in one package, the Pentium D brought multiprocessing to the personal computer for the first time.

18 Types of Multiprocessing (MP)
Symmetrical MP—The operating system assigns tasks as it sees fit. Asymmetrical MP—The program designer chooses the processor at the time the program is written. Two types of multiprocessing are possible: symmetrical and asymmetrical. With symmetrical multiprocessing, the operating system assigns tasks as it sees fit. With asymmetrical multiprocessing, the program designer chooses the processor at the time the program is written. The Pentium D (which we just discussed) and the Core 2 (which we will discuss next), both use symmetrical multiprocessing.

19 Dual Package versus dual core.
Dual Packages Dual Core CPU IC 2 Sockets 2 Heat sinks 2 Fans 2 Fan cable 2 Board Space X2 CPU IC 1 Sockets 1 Heat sinks 1 Fans 1 Fan cable 1 Board space X1 Why is having two processors in a single package so much better than using two processors in separate packages? Well mainly because the cost of the processing function is cut just about in half. Dual core needs only one CPU, one socket, one heat sink, one fan, one fan cable, and half as much board space. Dual packages needs twice as much of all the above.

20 Enter the Core 2 Duo Because the Pentium D was made up of two Pentium 4 cores, it was not optimized for dual processing. Intel redesigned the architecture of the CPU, optimizing it for multiprocessing. The result is called “Core” architecture. Apparently, this is a new trade name that replaces “Pentium”. One of the early processors to use this new architecture is the Core 2 Duo. Because the Pentium D was made up of two Pentium 4 cores, it was not optimized for dual processing. Intel redesigned the architecture of the CPU, optimizing it for multiprocessing. The result is called “Core” architecture. Apparently, this is Intel’s new trade name that replaces “Pentium”. One of the early processors to use this new architecture is the Core 2 Duo.

21 Core 2 Design This drawing shows a representation of how the Core 2 family of processors is constructed. Two execution core are shown at the top and a unified L2 cache is shown at the bottom. One of the problems with the Pentium D was that the dual processors each had its own independent L2 cache. If core 1 needed data that was in core 2’s L2 cache, it had to access it through the front side bus, which of course defeats the purpose of a cache. Also, in the Pentium D the total L2 cache space was always split 50/50 and could not change even though some other allocation might have been more efficient for a particular situation. Core 2 solved this problem with the Unified L2 cache, where the two cores share a common cache. Not only can each core directly access the entire cache space, the amount of cache “assigned” to each can be allocated on the fly to fit the situation. This is just one example of the design changes that Intel made to optimize Core 2 for multiprocessing. According to Intel, the Core 2 Duo is up to 40% faster than the Pentium D at the same clock speed and yet it runs considerably cooler.

22 The Core 2 Extreme Fastest of the Core 2 Duo series
Allows “over-clocking”, a technique that allows users to run the CPU at a higher clock speed than the manufacture recommends. A slight variation on the Core 2 Duo is the Core 2 Extreme. Think of it as the highest speed Core 2 Duo device. In addition, the Core 2 Extreme allows over-clocking, whereas the Core 2 Duo does not. Over-clocking is a technique used by some high-end enthusiasts in which the processor is run at a higher speed than that recommended by the manufacturer.

23 The Core 2 Quad First Core 2 Die Second Core 2 Die
And of course, it didn’t end there. It never does. In 2006, Intel introduced the Core 2 Quad. At the time this is being written, it consisted of two Core 2 dies in a single package. And while it is not available at the time, we predict that in the near future…

24 The Core 2 Quad Single Core 2 Quad Die
… all four cores will be placed on a single die. There is also an Extreme four core version. Again, the highest speed member of the family and with over-clocking allowed. Clearly, the race is on to pack as many cores as possible into a single package. It will be interesting to see where this trend eventually leads.

25 End This concludes the presentation.


Download ppt "Presentation 31 – Multicore, Multiprocessing, Multithreading, and Multitasking. When discussing modern PCs, the term “Multi” is thrown around a lot as."

Similar presentations


Ads by Google