Threads & Processes in CPU

Umesh NagareUmesh Nagare
2 min read

We often hear about threads when buying a processor or while working with programming languages like JavaScript, Java, Python etc. But what exactly is a thread, and how does it relate to both processors and programming?

What is a Thread?

A thread is the smallest unit of execution in a process. It’s a sequence of tasks that the CPU can execute.

When looking at processor specs, you may have seen something like "6 cores, 12 threads". But what does that mean?

Understanding CPU Cores

A core is a physical processing unit inside a CPU. It performs calculations and executes tasks.

Why Do We Need Multiple Cores?

Having multiple cores allows a computer to handle multitasking efficiently. For example, you can listen to music while coding in Visual Studio Code or keep multiple browser tabs open without lag.

Relation Between Cores & Threads in a Processor

  • Each core can handle at least one thread at a time.

  • Modern CPUs use Simultaneous Multithreading (SMT) which allows one core to handle two threads.

  • This is why a 6-core, 12-thread CPU can run 12 tasks simultaneously, making it more efficient than a 6-core, 6-thread CPU.

Example:

  • 6-core, 6-thread CPU → Can handle 6 tasks at the same time.

  • 6-core, 12-thread CPU → Can handle 12 tasks at the same time (because each core manages 2 threads).

Checking Threads & Processes on Your PC

Want to see how your CPU handles processes? Open Task Manager → Go to Performance tab → Click on CPU Activity.

You’ll notice something like:

  • Processes: 186

  • Threads: 2208

  • Logical processors (threads): 8

What Does This Mean?

  • Logical processors = Your actual CPU threads (for example, if you have 4 cores with Hyper-Threading, you’ll see 8 logical processors).

  • Processes = Running applications (each software program is a process).

  • Threads = The number of active execution units running across all processes.

Even though your CPU might only have 8 hardware threads (logical processors), your operating system manages thousands of software threads, switching between them millions of time and manging multi tasking efficiently.

What Happens When You Open Chrome?

Each tab can have more threads depending on the task.

When you open Google Chrome, the browser creates multiple processes and threads to improve security and performance.

Process Model in Chrome

Chrome follows a multi-process architecture, meaning different tasks run in separate processes for stability and security. Each tab in Chrome has multiple threads


0
Subscribe to my newsletter

Read articles from Umesh Nagare directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Umesh Nagare
Umesh Nagare