What are the differences between a thread and a core in a CPU?

280 views

What are the differences between a thread and a core in a CPU?

In: 14

10 Answers

Anonymous 0 Comments

A CPU is a Central Processing Unit, a piece of hardware, that among other things calculate. It has a number of cores to execute instructions.

A thread is a programmatic task which has the responsibility of executing specific instructions. Threads are used in parallelism/simultaneous operations.

Threads run on CPU. You can have several hundreds of threads running simultaneously on your computer and they’re fighting amongst each other to get to use the CPUs cores.

When a thread is spawned it is queued to run on the CPU cores.

ELI5 example: if you have an app that has to calculate or grab some external data from e.g. a server, it runs on threads. If the app only used one thread then the graphical user interface would freeze completely while it was grabbing data from the external server. In order to avoid that a programmer will usually spawn a separate thread to grab data while the user can still navigate in the app, which uses another thread, simultaneously.

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