Difference between multicore and multithreading

A place to talk about GPUs/Motherboards/CPUs/Cases/Remotes, etc.
Post Reply
User avatar
Jade10145

Posts: 73
Joined: Sat Mar 10, 2012 2:17 am
Location: Massachusetts

HTPC Specs: Show details

Difference between multicore and multithreading

#1

Post by Jade10145 » Tue Apr 10, 2012 8:09 pm

Hi,

I am trying to understand the difference between multithreading and multicore processors.

I'm sure its far more complicated but at a basic level I see it as this,

Multicore= increases performance in regards to multitasking. Programs can run on each core seperatley. Does not require software support. The OS must be designed for multicores.
Multithreading= for software that is built for multithreading, it allows each thread to be worked on by each core independenly. Therefore making the single process faster. Helpful in video rendering or other CPU intensive tasks.

So the question is, would 4 programs running at the same time be more effeicent on a quad core as opposed to a dual core?

Thanks in advance. I am researching this because I am trying to determine if the number of cores allowes more tasks to occur as the same time. (multitasking). And if so, how many tasks? How are the tasks divied up? What determines this?
Tyler Durden: It's only after we've lost everything that we're free to do anything.

Tyler Durden: Now, a question of etiquette - as I pass, do I give you the ass or the crotch?

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#2

Post by barnabas1969 » Tue Apr 10, 2012 9:02 pm

EDIT: Due to the default font on this site, it's hard to see the difference between G and C (GPU and CPU), so I changed every occurrence of GPU (Graphics Processing Unit) to red text.

Well, actually, it's a little more than that. Windows 7 automatically handles multi-core and multi-threading, even if your application does not.

Basically, Multi-threading gives you a 0-20% performance boost, where multi-core gives you a 0-80% boost per core, depending on the app. If the app is CPU hungry (lots of computations, like audio/video encoding), multiple cores can really improve performance. On the other hand, if the app is I/O hungry (lots of disk reading/writing), you're still limited to the I/O throughput of your hard drives, network interface, and other I/O interfaces (USB, serial, IEEE-1394, etc) that the app requires, no matter the number of cores or threads. The truth is that most applications do both... computations and I/O. So your performance boost with multi-core or multi-thread varies depending on the ratio of computations vs. I/O that the app requires. An on-line-transaction-processing (OLTP) app, for example, is mostly I/O and very little computation... so I/O is the most important thing to be concerned with. An app that is doing some intense vector graphics, compression, and encoding is going to use more CPU time. Additionally, things like compression and encoding use RAM extensively (RAM is also an I/O device from the CPU's perspective), so faster RAM and a faster front-side-bus speed (FSB) on the CPU will speed up an encoding/decoding/compression process too. Make sense? That's why graphics cards tend to have much faster RAM than your system RAM, and one of the reasons why a graphics card is better than on-motherboard graphics (because on-board graphics shares your system RAM, and that RAM isn't as fast as what's on a dedicated video card).

Now, for video rendering, that's handled mostly by your Graphics Processor, so your CPU is not involved with that very much. If you're talking about video ENCODING, then that's a different thing altogether. Some software works with specific GPU's and will use the GPU's video renderer, scaler, shader, etc to encode the video. Other software will not work with your GPU, and the CPU is used instead. A GPU is designed specifically to handle video, so if your software will make use of the GPU, it will encode video much faster than an app that uses the CPU exclusively. Think of it as a "right tool for the right job" scenario. A GPU was built for video. It does a fantastic job at scaling, compressing, and decompressing video. A CPU, on the other hand, is a swiss army knife. You can use it for just about everything, but it doesn't cut glass as well as a glass cutter. Get it?

The number of tasks and how they are split between the processor cores is controlled by Windows 7.

Again, you're over-thinking things. You've bought the i3 CPU already and you seem locked-in with that CPU. You're going to buy the GT-430 video card. If you don't have a significant I/O bottleneck, and you put the encoding processes in a lower priority, you won't see a difference in live/recorded TV. You're not in a big hurry to encode video files while you simultaneously watch TV, are you? Then you can put the encoding process in a lower priority. Some software will do this automatically, while others require you to do it manually. Some allow you to run the encoding process from a command line, and at the command line... you can specify the process priority.

As I mentioned in another thread, commercial skipping, by default, runs in a lower process priority. You really won't notice that it's even happening in the background. I've pegged all four cores of my CPU at 100% busy when scanning for commercials on multiple recordings... and watching TV/navigating menus works just fine while the scanning is happening. I don't notice any delay at all. I'm sure you can do this with encoding too... but the ease or difficulty of that will vary with the software you choose to use.

crawfish

Posts: 465
Joined: Fri Jan 13, 2012 5:16 am
Location:

HTPC Specs: Show details

#3

Post by crawfish » Tue Apr 10, 2012 10:28 pm

Jade10145 wrote:Hi,

I am trying to understand the difference between multithreading and multicore processors.
I guess you mean hyperthreading vs multicore. The term "multithreading" describes a software technique in which programs can create multiple threads of execution. A hyperthreaded CPU allows each core to achieve some degree of parallel execution for whatever number of threads it is designed to support, typically two. It is a little better than a non-hyperthreaded CPU, but nowhere near as good as having multiple cores, which are basically separate CPUs on the same chip, which can each run a thread at full speed.
So the question is, would 4 programs running at the same time be more effeicent on a quad core as opposed to a dual core?
Often yes, but it depends totally on the 4 programs and their patterns of CPU usage and I/O usage. For example, converting a large number of files from one lossless audio format to another using a single hard drive becomes I/O bound very quickly, such that more than two threads hurts performance terribly in all the programs I know of, including foobar2000, dbpa, Easy CD-DA Converter, etc. The big improvement to be had there is to use different drives for the source and destination. However, as you increase the number of threads, eventually you will again become I/O bound, as this is a disk-intensive process that requires relatively little CPU power. How do you know when this happens? Well, the hard drive will make a lot of racket, the disk usage in Resource Monitor will approach 100%, the CPU usage will approach 0% for long periods of time, and it will take far longer than if you had limited the program to a smaller number of threads.
Thanks in advance. I am researching this because I am trying to determine if the number of cores allowes more tasks to occur as the same time. (multitasking). And if so, how many tasks? How are the tasks divied up? What determines this?
Programs divide themselves up into threads. The OS contains a component known as "the scheduler" which assigns threads to CPUs and governs how long they get to run before being interrupted and possibly being allowed to run again for another time slice or being put on hold so another thread can run for a while. Ignoring hyperthreading, which gives minimal gains, and greatly simplifying, if you have N threads and N cores, each thread can run at full speed indefinitely, which is great for CPU-bound threads. In practice, you will tend to have a mix of CPU and I/O bound threads. The challenge for a given program is to divide itself into threads that maximize the usage of the hardware, and the challenge for a given user is to run a mix of programs that interfere with each other as little as possible. For example, you don't want to run 4 CPU-intensive processes on a quad-core system at the same time as you want to do something interactive than can require significant CPU, nor do you want to run more than 4 CPU-intensive processes at once if your goal is to reap the potential speed benefits of multiprocessing. Likewise, you want to avoid running two programs at once that each want to consume all available disk I/O bandwidth, because you will tend to observe worse performance than if you had run them one after the other, due to their simultaneous execution degrading into essentially a random I/O benchmark.

barnabas1969

Posts: 5738
Joined: Tue Jun 21, 2011 7:23 pm
Location: Titusville, Florida, USA

HTPC Specs: Show details

#4

Post by barnabas1969 » Tue Apr 10, 2012 10:57 pm

Good answer, crawfish. I didn't want to get into CPU scheduling. It's different on every Operating System, and I'm most familiar with how it works on the MPE operating system from Hewlett Packard. And sorry for not catching the difference between hyper- vs. multi-threading. I totally agree with you about hyper-threading giving little benefit. I'm also not sure why the OP is asking about it, since all the latest CPU's from Intel and AMD are multi-core.

In addition to it being possible to become I/O bound, where so many processes are competing for I/O that virtually nothing gets done, it is also possible for the scheduler to juggle so many processes that are waiting for the CPU that nothing gets done on the CPU either. But that's not likely on a PC... I see it mostly on multi-user systems like Unix and MPE.

User avatar
Jade10145

Posts: 73
Joined: Sat Mar 10, 2012 2:17 am
Location: Massachusetts

HTPC Specs: Show details

#5

Post by Jade10145 » Wed Apr 18, 2012 4:52 am

The reason I was asking about multi-threading is because I am somewhat new in the area of well, computers on a deeper level.

Here's what I mean. I have familuarity with hardware from the aspect of putting it all together. I know at a general level how all the parts work with each other, what goes where etc. To summarize, I know far more then the average end user, but far less then....well folks like you haha. I am basically looking to deepen my knowledge.

Thanks for the responses.
Tyler Durden: It's only after we've lost everything that we're free to do anything.

Tyler Durden: Now, a question of etiquette - as I pass, do I give you the ass or the crotch?

Post Reply