aspose file tools
The moose likes Threads and Synchronization and the fly likes different between core and threads and maximum threads can be use in program Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "different between core and threads and maximum threads can be use in program" Watch "different between core and threads and maximum threads can be use in program" New topic
Author

different between core and threads and maximum threads can be use in program

Sara Brown
Ranch Hand

Joined: Feb 22, 2012
Posts: 55
Assume processor core i5 have 2 cores and 4 threads.

my questions:
1- if we make a program using more than available threads in the processor (more than 4 threads), what will happen to the program? Is the program can still be run faster than the sequential program?
2- 2 cores, 4 threads. does that means each core can run 4 threads or each core run 2 threads?

please help. im not good enough with the core and threads.
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 3036
    
    4

Wethher an app that uses more threads than those available to the CPU runs faster than one that doesn't depends a lot on the application and what it does. If the application is processor intensive - if it has a lot of calculations and uses a lot of CPU cycles, then the chances of it running faster with more threads is low. If there are a lot of gaps where the thread has to wait for I/O or for some event, then it could run faster with more threads.


For the second question: that would be a question for Intel documentation, but no, the i5 has 2 cores, each of which can run 2 threads, for a total of 4.


Steve
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: different between core and threads and maximum threads can be use in program
 
Similar Threads
Need help understanding results from running 2 threads
Is Concurency dependent on CPU architecture?
collection query
multithreading
Multi-Core Vs. Single-Core (For the serious Java Archs)