Quantcast

Maximum PC

It is currently Sat Sep 20, 2014 5:11 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Quad and Hexcore, What is the Difference?
PostPosted: Fri Jul 08, 2011 7:43 am 
8086
8086

Joined: Wed Jul 04, 2007 10:44 am
Posts: 3
Location: Oregon
Yes, I know the difference between 4 and 6 cores - what I want is an explanation of what threads are and how they relate to the quad and hexcore cpu's. I am trying to decide on a quad or hexcore and after learning some things I need help on this. Please answer. This appeared to be the best place to ask this question since a cpu is hardware and I am trying to figure out which one is most appropriate for programming software.

*What is a "thread"?
*What is a thread used for?
*How do the number of threads affect cpu performance?
*How many threads are there in a quad? In a hexcore?
*Why can't current software take advantage of more threads?
*What apps do you know of that currently take advantage of the additional two cores in hexcore cpu's? Please mention one or more if you can.
*Do you own a hexcore? If so, which one? Have you seen a difference between this hexcore and any prior cpu's you have owned?

I am also interested in programming. If you know, how would I create an application that actually takes advantage of the extra threads in the hexcore and
what language or compiler could do that best? C++? Not sure. Please suggest a software compiler that would work best.


Any other comments are welcome that fill in the gaps on this question - thanks for your help.


Top
  Profile  
 
 Post subject: Re: Quad and Hexcore, What is the Difference?
PostPosted: Fri Jul 08, 2011 10:19 am 
Bitchin' Fast 3D Z8000
Bitchin' Fast 3D Z8000
User avatar

Joined: Mon Jun 14, 2004 4:04 pm
Posts: 985
Location: Earth
jimc52 wrote:
Yes, I know the difference between 4 and 6 cores - what I want is an explanation of what threads are and how they relate to the quad and hexcore cpu's. I am trying to decide on a quad or hexcore and after learning some things I need help on this. Please answer. This appeared to be the best place to ask this question since a cpu is hardware and I am trying to figure out which one is most appropriate for programming software.


This may belong to Programmers Paradise, but I'll let them mods move it. :)

Quote:
*What is a "thread"?

A thread is a unit of execution. So an application runs as a process, within processes a thread exists.

Quote:
*What is a thread used for?

A program uses threads to run. All application have at least ONE thread.

Quote:
*How do the number of threads affect cpu performance?

Loosely put - it depends. Most CPU's implement some sort of multi-tasking capacity - either it's time slicing or round-robin. It's hard to say about performance. Though, if an app spawns too many threads, it can eat up valuable CPU time.

Quote:
*How many threads are there in a quad? In a hexcore?

Kind of an odd question because there isn't a law that goes thread == core/CPU. The OS handles thread management. See, when you launch an application (i.e., Process) it talks to the OS for resources. If it needs memory, it asks the OS. When you spawn (i.e., make) new threads, the application itself doesn't handle the thread, the OS does. The application tells the OS "hey, I have a new thread...so you might want to assign it a resource". So a four or six core CPU can execute thousands - if not, millions - of threads.

Quote:
*Why can't current software take advantage of more threads?

Again, it largely depends. Remember that software is designed to solve a problem domain. That in mind, if software is designed to solve a problem then the number of threads needed is largely based on the problem at hand. It's difficult to say "Why can't current software take advantage of more threads?" because there are apps that are naturally multi-threaded (i.e., more than one thread). However, 90% of apps only need one thread. For example, SQL Server is highly threaded because it has to respond to a query and create an execution plan for it. Microsoft Word is not heavily threaded (if at all) because it mostly does one thing (write, save/print)./

Quote:
*What apps do you know of that currently take advantage of the additional two cores in hexcore cpu's? Please mention one or more if you can.

SQL Server, Folding at Home, SETI at Home...

In cases like these, they may not have multiple threads but have parallel tasks. So they may not be multi-threaded but they execute parallel tasks. SQL Server is a VERY threaded application. Web Servers like Apache or IIS are also heavily threaded since each browser request is a thread of execution.

Quote:
*Do you own a hexcore? If so, which one? Have you seen a difference between this hexcore and any prior cpu's you have owned?


I own a quad-core, and no, there's no real difference in performance of stuff I write. Though, Bad Company 2 does run faster on my new quad-core i5-2500K than it did on my Core 2 Duo. ;)

Quote:
I am also interested in programming. If you know, how would I create an application that actually takes advantage of the extra threads in the hexcore and
what language or compiler could do that best? C++? Not sure. Please suggest a software compiler that would work best.


I'm not a master of threaded apps, so take this as more of a launch point for your research.

Every language is designed to solve a particular problem and many of these same languages can spawn one or more threads. C/C++ uses POSIX threading, which is a PITA to write for. C# uses a similar POSIX model but is more user-friendly. Java is also multi-threaded, and it does it well. Ruby doesn't use threads, it uses fibers. Python is threaded. Now, Erlang, is designed to be multi-threaded and scalable.

My advice to you (and I"m sure people will back me up):

- If you're interested in programming, start with programming.
- Don't worry too much about threading. Threading has its own set of devils: devils that you do not want to encounter early on. For example, some error conditions are deadlocks and race conditions. Threading is advanced, skip it for now but keep it in the back of your mind.
- 90% of the problems you will solve do not involve threads. Even the most algorithmic solution you can think, generally can be ran on a single thread.
- You'll understand that threading is not the same as parallelism. Threads are not really core aware because you can have five threads being processed by two out of four cores. CPU scheduling dictates which resources go into which CPU. However, parallelism is far more unique - because if a thread is a single instance of work, parallelism takes work and breaks it down to multiple cores/CPU's. You can have an app with a single thread but if it uses parallelism, then it can distribute work efficiently against all CPU's and cores. Again, this is advanced topic, do NOT worry too much about it.


Top
  Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group