A cloud storage company explains the terms 'program', 'thread' and 'process'
Programs such as Word, Excel, and Google Chrome can be divided into units such as 'processes' and 'threads.' Backblaze, which develops cloud storage services, explained the meaning of these terms.
Threads vs. Processes: A Look At How They Work Within Your Program
A program is a piece of code stored on your computer that performs a specific task. There are many types of programs, some built into the OS and others that perform specific tasks. A program specialized for a task is commonly called an application. For example, web browsers and games are applications.
Many programs are written using programming languages such as C, C++, C#, etc., but are eventually translated (compiled) into binary form (1s and 0s) to run on a computer, where the code is It will be a text file. A computer's central processing unit, the CPU, can only understand instructions in binary format.
Once the program is in binary form and loaded into memory, it next needs resources from the OS and memory. You can't use a program without resources.
The OS automatically manages the task of allocating resources to programs. It always dictates what resources your program needs to run on any OS, be it Windows, macOS, Linux or Android. A process is a program loaded into memory with its resources, and a thread is the unit of execution within a process . A process can have one or many threads. Using the YouTube application as an example, a process is what launches when YouTube itself runs, and a thread is what handles the details within YouTube.
Each thread in a process shares the memory and resources allocated to the process to do work, but it can stop working if resources are exhausted or problems occur. For example, when you open multiple tabs in one browser and each tab performs a different process such as playing a video or downloading.
Google Chrome, a web browsing application, avoids this by treating each tab as a separate process instead of a thread. This is because the processes do not interfere with each other and each process can use its own resources. By running each tab as a single process, the entire application is protected from bugs and glitches.
The image below represents the process of Google Chrome with many tabs open. You can see that some processes are using a lot of CPU and memory, but others are using very little.
Backblaze says, ``Your system's Activity Monitor (Task Manager) can be a valuable ally in tweaking your computer and troubleshooting problems. If it doesn't respond for a while, you can use the system monitor to check its status, you may see a process marked as Not Responding, kill that process, and restart your system. Try to see if it works better, and if your application is memory intensive, consider choosing another application that can perform the same task.'
Related Posts:
in Software, Posted by log1p_kr