I'm confused about threads in a CPU?

Agash

Distinguished
Jan 5, 2014
313
0
18,810
Okay, so I know what a CPU thread is but I don't know how it works. If I open up my task manager and go to the performance tab, it says 800 threads. I have a quad core with 4 threads, so how does it work together? Also, let's say an application is using 20 threads and you have a 4 threaded processor, does it just load it 5 times simultaneously? Are multi-threaded applications better than single-threaded? And is it harder to do so? Last thing, is windows scheduler bad?
 
Solution
Each thread on your CPU, in this case, would handle 5 job threads each if the application was properly multithreaded. Modern CPUs can handle thousands of job threads. In the case of your example, simply a CPU worker thread would be tasked with handing 5 job threads each (20/4). Hope that makes sense.
Basically, a CPU core is known as the worker thread. So a quad core CPU for example would have 4 logical (physical) worker threads. In the case of hyperthreading, a CPU might have 2 worker threads and two other threads, so it has 4 threads in total. The task manager is simply stating that 800 different "jobs" are running at the moment. Each thread on a CPU handles a certain amount of the job threads.

If an application uses 4 threads for example, a 4 core CPU will load it 4x faster than a single core. Multithreaded apps, as a result, are better if you have a multithreaded CPU. Games are becoming multithreaded now.
 
Each thread on your CPU, in this case, would handle 5 job threads each if the application was properly multithreaded. Modern CPUs can handle thousands of job threads. In the case of your example, simply a CPU worker thread would be tasked with handing 5 job threads each (20/4). Hope that makes sense.
 
Solution
I think it's where many job threads run in tandem with each other at once, instead of having to wait for the job threads to finish before starting a new job. So basically parallel computing to my knowledge allows a system to get a job done faster.
 

TRENDING THREADS

Latest posts