Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Intel Pentium Processor E5700 (2M Cache, 3.00 GHz, 800 MHz FSB) does not have hyper-threading but it has has 2 cores so I am assuming it has 2 threads

Now if I write a heavy number crunching program that runs 4 threads simultaneously how will this E5700 processor handle 4 threads simultaneously using its 2 cores and 2 threads, compared to a processor like the Intel Core i3-3110M Processor (3M Cache, 2.40 GHz) with hyper-threading which has 2 cores but 4 threads?

Will the E5700 be slower and have bottlenecks than the i3 3110m with 2 cores but 4 threads with hyperthreading, or will everything be smooth sailing and fast on both processors without noticing anything different?

Also, can a program written with four or more threads run efficiently on a 2 core 2 thread processor or will there be errors or slowdowns?

#

ok thanks for answering the questions later I visited this site and shorter score is better for processors

http://www.cpu-world.com/benchmarks/socket_1155_multi.html

Benchmark wPrime v1.55 (32M) wPrime benchmark measures time taken to calculate square roots of numbers from 1 to 33554431. The program uses Newton's method for estimating functions.

CPU features that have big influence on results: CPU frequency, Floating-Point performance, the number of cores / threads.

CPU features that have small influence on results: memory speed, the size of internal caches.

Part number Shorter is better Result

Intel® Core™ i7-3770K Processor (8M Cache, up to 3.90 GHz) 4 cores 8 threads yes HT

6.87

Intel® Core™ i7-2600k Processor (8M Cache, up to 3.80 GHz) 4 cores 8 threads yes HT

7.57

Intel® Core™ i5-2500K Processor (6M Cache, up to 3.70 GHz) 4 cores 4 threads no HT
9.8

Intel® Core™ i3-2310 Processor (3M Cache, 2.10 GHz) 2 cores 2 threads yes HT
15.37

Intel® G860 (3M Cache, 3.00 GHz) 2 cores 2 threads no HT
22.09

#

share|improve this question
add comment

3 Answers

up vote -3 down vote accepted

Yes it will be slower but you already knew that and i don't know why your asking. Now about 4 threads on a 4core CPU vs a 2core with hyperthreading, well the hyperthreading will be slower as two threads share the same core and its resources (like cache). However is one thread isnt hogging/thrashing cache its really really fast, i don't know how close but i notice on my machine it feels like 8 cores.

Also if its written well multithreading apps wont care if you are have 2 or 20threads, it will just use it as much as possible in a nonblocking way. Typically people say you should run only as many threads as your system has for best preformance (so 2x2 threads or 4x1 thread is the same). However many app has blocking calls such network, disk reads, etc so it doesn't apply because you want to switch threads instead of making the cpu idle which is the point of threads.

share|improve this answer
    
ok yes i knew more real cores are better than logical cores and hyperthreading so the thread switching if handled by the OS or by programmer us which will be more more efficient the programmer or just leave it to the OS ? –  De coder Nov 16 '12 at 13:37
    
Just leave it to the OS there is no reason to write your own threading code. Its like writing your own console code except their threading code is much more optimized. –  acidzombie24 Nov 16 '12 at 14:11
    
ok you mean there will be errors and slowdowns in the applications if we do things like manually setting thread priorites in the app for the OS to follow while switching threads and this must be avoided –  De coder Nov 16 '12 at 14:14
2  
I honestly I dont think this is a helpful answer. –  Ramhound Nov 16 '12 at 14:34
1  
@VincentVancalbergh: oh wow I didn't know this went into negatives. I don't know if I was half asleep or not but I believe I assumed basic CPU knowledge and wrote the answer specifically for op. I see I wrote is instead of if but I'm too lazy to correct or rewrite it. If op answered more generically i'd make a more generic answer but it looks like he understood perfectly which was my goal. –  acidzombie24 Jul 6 '13 at 0:00
show 2 more comments

For some background knowledge on threading, CPU cores, and hyperthreading, you may want to read the question What are threads, and what do they do in the processor?


Now if i write a heavy number crunching program that runs 4 threads simultaneously how will this E5700 processor handle 4 threads simultaneously using its 2 cores and 2 threads

The number of threads your application requires is irrelevant - I can write a program that starts 1000 threads, and they all run at the "same" time. The key here is your operating system's scheduler, which runs each thread on a particular CPU core for a particular unit of time (the order in which the threads are run, and on what core, depends on the scheduling algorithm).

Compared to a processor like the Intel® Core™ i3-3110M Processor (3M Cache, 2.40 GHz) with hyperthreading which has 2 cores but 4 threads

It's impossible to compare the application performance with a similar processor, albeit with hyperthreading. Applications need to be specifically optimized for it (since there are still only half the number of physical cores as there are logical). In some various cases, applications may run faster with hyperthreading disabled (although many applications do benefit from it). Regardless of hyperthreading, an increase in the number of physical cores will always benefit multithreaded applications.


Lastly, you're comparing an E5700 and an i3 3110m. These are two different (not completely, but they are different) processor architectures; they have different features, and unequal pipeline lengths 1 2. There is more to consider here than just the raw number of processor cores, but for the purposes of this discussion, you can ignore them and just read what I've written above.

  1. J. De Gelas, "The Bulldozer Aftermath: Delving Even Deeper." AnandTech, pp.2.
  2. Intel® 64 and IA-32 Architectures Software Developer Manuals, Vol. 1, Ch. 2, Sec.2.3 - Intel® Core™ Microarchitecture
share|improve this answer
    
ok yes an application optimized for 4 cores/threads will run slower on a 2 core system because as always real cores are better than logical cores with hyperthreading and so which is better should the programmer code and set the important threads as high priority in his application or will there be errors slowdowns like that or should he leave all the threads to the OS scheduler and hope and expect that the application will run fast smoothly and correctly if the OS handles everything –  De coder Nov 16 '12 at 14:02
    
@Decoder again, when you bring speed into the equation, things change. If this were a perfect world, I could have a 2-core 3.0 GHz processor that would run your program just as fast as a 4-core 1.5 GHz processor (holding all other factors constant). The job of the OS is to run the program as fast as possible with your given hardware; unless this is a real-time system (and Windows is not a real-time OS), the application will run fine (albeit somewhat slower). –  Breakthrough Nov 16 '12 at 14:21
add comment

The other answers are correct that for compute bound tasks running with 4 threads on 2 cores will be slower than 2 threads. There is overhead in scheduling the threads, as well as the context switch in the cpu when the register state is switched. The one thing that does not seem to be pointed out however is that this does not hold if there is blocking I/O in those threads. In such a case it is likely that having more threads than cores will run faster, since threads will block on the slow I/O operations and allow other cpu bound portions of code to still run.

share|improve this answer
    
yes because of the hyperthreading the OS sees the 2 cores 4 logic threads as really 4 cores so it must be seeing more idle resources available so it will probably run the 2 extra threads when the other 2 are waiting for I/O –  De coder Nov 16 '12 at 15:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.