• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How many application threads can concurrently run on my machine?

 
Chan Ag
Rancher
Posts: 1089
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings,

Could you tell me how many threads can concurrently run on my machine. Following are some of the details I have, based on what google suggested.

1. When I go to device manager and click on Processors tab, I see 8 tabs. Screenshot is attached. So do I have an 8-core processor.
2. Also when I click on task manager-performance tab, I see 8 CPU history boxes in the CPU usage section. Screenshot attached.

So can 8 threads concurrently run on my computer?

Thanks,
Chan.



DM.png
[Thumbnail for DM.png]
PerformanceTab.png
[Thumbnail for PerformanceTab.png]
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That depends on your definition of "concurrently" and what kinds of threads you're talking about. Given the deep pipelines and multiple functional units of modern CPUs, an 8-core CPU will have many more than 8 instructions being worked on in parallel, probably closer to 80.

On the Java side, you can probably start hundreds (maybe thousands) of threads and have them all make progress without putting any one explicitly to sleep - the JVM will do that on its own. But a thread context switch takes many instructions to execute, both for OS-level threads and for Java threads, so the overhead of thread management will make this inefficient sooner rather than later.

Also keep in mind that the OS needs CPU time for its dozens of processes, and the JVM needs time for its own threads, so you will never get all 8 cores working on your application code.
 
Chan Ag
Rancher
Posts: 1089
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Ulf.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic