What is a thread?

Опубликовано: 04 Март 2026
на канале: Celso Kitamura | Mentor de Programadores
19,080
1k

Do you know what a thread is? Have you ever heard of it?

In this video, I'll show you a little about this much-talked-about but little-understood term.

Let's talk about threads and how they work.

What is a Thread?

A thread is a part of the code that can be executed independently of the main program.

For example, a program can have a thread open waiting for a specific event to occur or performing a separate job, allowing the main program to perform other tasks.

A program is capable of having several threads open at the same time and will terminate or suspend them after a task is completed, or the program is closed.

A Little History

Threads made an early appearance in OS/360 MVT (Multiprogramming with a Variable Number of Tasks) in 1967, where they were called tasks. The term thread was attributed to Victor A. Vyssotsky.

Process schedulers in many modern operating systems support both types of multithreading: time-sliced ​​and multiprocessor, and the operating system kernel allows programmers to manipulate threads, exposing the necessary functionality through the system call interface. In other words, we can use threads in our applications.

Single-Processor and Multiprocessor Systems

In the early days of computing, only single-processor computers existed, meaning they had only one processor. In these systems, multithreading (parallel processing of threads) was implemented through time slicing.

The CPU (Central Processing Unit) switches between different software threads. This context switching happens fast enough for users to perceive the threads or tasks as running in parallel.

Because the speed of execution switching between threads is much higher than we can perceive, it seems as if the programs are running simultaneously. So, in reality, it's all just an illusion.

In a multiprocessor or multi-core system, several threads can execute in parallel, with each processor or core executing a separate thread simultaneously.

For a long time, only servers had multi-core processors because they were very expensive. However, nowadays we already have multi-core processors in laptops and smartphones.

Final Words

In short, a thread is the smallest unit of processing that can be executed in an operating system. In most modern operating systems, a thread exists within a process, and a single process can contain several threads.

As already mentioned, we can use this functionality and increase the performance of our application.

For example, the user can continue using the application while we query a table on the server or load a video into memory.

And that's all for today!

And if you want to learn more about programming, keep following me!

If you liked this video, give it a like and subscribe to the channel. Don't forget to activate notifications to receive an alert when new videos are published. Until next time!

Follow me here ⤵⤵

💻 Blog: https://celsokitamura.com.br
💻 Instagram:   / celsokitamura  
🎥 Youtube:    / celsokitamura  
🔵 Facebook:   / celsokitamura  

#WhatIsThread

#IAmAnAppDev