What is the role of the cores/threads in a CPU, and how do they differ?

67 viewsOtherTechnology

I’ve watched YouTube videos but I still don’t get their analogies. I just know for tasks like gaming it’s done through 1 thread only, that’s about it.

In: Technology

7 Answers

Anonymous 0 Comments

There are cores, processes, and threads.

Cores = physical “sub-CPUs” within the CPU

Processes = One instance of a running program. If you have two instances of Notepad open, that’s two processes. Each process has its own assigned chunk of memory and can’t directly access memory belonging to other processes.

Threads = multiple things a process is doing. Having multiple threads can sometimes allow a program to get work done faster because the CPU can divide the threads between cores (e.g. “ok, core 1, you take thread 1, core 2, you take thread 2”).

Programs can be “single threaded”, “multi-threaded”, or “multi-process”.

Single threaded program = the program is not written to split its work up. This is the default: unless you deliberately write a program to use multiple threads or processes, it’s a single threaded program.

Multi-threaded = the program is able to divide at least some of its work into tasks that can be done separately at the same time. This takes extra work because the program must be carefully written so different threads don’t interfere with each other.

Multi-process / multiprocessing = the program runs additional copies of itself and they cooperate. More common in scientific computing and big data / cloud computing. Has the disadvantage that processes can’t pass information between them as easily, but the advantages that the program may be easier to write (if each process is single-threaded), one process crashing is less likely to bring down the whole program, and (this is a big one) you can have processes running on multiple computers.

For something like a game, it’s likely the program is using multiple threads, but because a lot of the program’s work is dependent on the previous step, it can only split a limited amount of work off to additional threads.

You are viewing 1 out of 7 answers, click here to view all answers.