Does multiple cores in CPU affect how many programs I can run?

11,622

Solution 1

Operating systems use the concept of processes and threads for running programs.

When you load a program, a process is created. The process has its own memory and credentials and that process can only read/write to its own memory and do through the kernel whatever its credentials allow.

On a single CPU system, the OS goes through each running process and gives it a portion of CPU time, round robin. Only one process actually executes in a given instant of time. (If a process is waiting or "blocked" for I/O, a very common condition, it is skipped.)

A process can split part of itself off as a thread. This is essentially two parts of a single process having two separate turns on the CPU (all of a processes threads "live in" the process and can see its memory).

A process can also

  • spawn another separate, new process - i.e. load a separate program. Windows Explorer spawns processes when it launches programs.
  • fork another process - i.e. create a copy of itself, as a separate process (not a thread) - this is common in Unix/Linux operating systems.

If there is more than one CPU core, while a process begins on a single core, the OS can place its threads on other cores, and if the process spawns or forks other processes, it can place them on other cores than the parent process.

The OS manages which cores it uses and might even transparently migrate processes to different CPUs from time to time to keep things balanced. On Windows and probably Linux you can pin CPU "affinity" so it stays only on specific cores if you wanted.

So, if the application spawns threads and/or processes to accomplish its work, it will benefit from multiple CPU cores. If it doesn't, that specific program will not. Your OS will still be assigning other programs to other cores, so it can mean other programs will have less of an impact on your single-threaded single-process program.

Solution 2

It depends if the application makes use of the cores. For rendering like the programs you listed then yes, those type of applications should make use of the most cores, so the program would perform faster. It shares the load across all the cores made use of.

If you're doing multiple processor intensive tasks in several applications at once, it will speed things up (provided you have enough RAM to do that).

(like each core for one program, etc.)

More like all programs spread across all cores.

Games though (modern ones) only utilize about 4 cores, let alone the older games, so going for more cores won't make a difference.

So, in short: Extra processor cores will only enhance system performance on heavy applications that support multiple core use. Extra cores will also enhance multitasking. To make a lighter system (smaller applications such as web browsing) run faster you need a higher clock speed instead.

Share:
11,622

Related videos on Youtube

charlie
Author by

charlie

Updated on September 18, 2022

Comments

  • charlie
    charlie over 1 year

    I have question about multiple cores in CPU. Let's say I am working in few programs at the same time, for example: - Photoshop - Autodesk Maya - Visual Studio - Unreal Engine

    If I would have more cores in my CPU it would mean that those programs would perform faster(like each core for one program, etc.)

  • I say Reinstate Monica
    I say Reinstate Monica over 9 years
    Good point drawing out the fact that single threaded programs benefit from higher CPU speed vs multiple cores.
  • The Muffin Man
    The Muffin Man about 5 years
    Given a 2 core CPU and the OS has assigned MS Word to Core 1 and MS Excel to Core 2 does that then mean if Word somehow uses 100% cpu temporarily that Excel would still run flawlessly since it's a seperate core? For the sake of the concept let's assume that Core 1 being tied up isn't bogging down other system process such as handling mouse movements etc.
  • LawrenceC
    LawrenceC about 5 years
    It would. But 100% CPU isn't the only thing that makes programs freeze or go slow. Examples: A) Both cores share the same RAM, and if Excel takes all the RAM, Word will still experience problems even if tethered to its own core. B) If Excel tries to write to a hard drive the same time Word does, one of them will have to wait.
  • The Muffin Man
    The Muffin Man about 5 years
    Thanks for confirming that. There seems to be a common misconception that it's pointless to have a multicore CPU unless you are paralyzing work such as rendering or running other applications that specifically leverage multiple cores. With so many people working with dozens of chrome tabs open and multiple other applications simultaneously these days it seems that multi core cpu's can be a big benefit.