Tutorials

What is a computer process and what is its function?

Table of contents:

Anonim

Surely you've even heard of killing a process in Windows, or that a program has been blocked. Today we explain what it is and we will also see the differences with a thread, a term very popularized due to the processing threads.

What is a process

In computing, a process is basically a program that runs. Processes are a succession of instructions that aim to reach an end state or that pursue a specific task. The most important thing about this concept is where a process comes from or what a program and an operating system really is.

The operating system is the basic software of a computer, with it, the user is able to interact from a graphic environment or through text inputs in the form of instructions. The operating system is capable of running other processes within itself and even creating them using programming code and a compilation.

For its part, a program is an algorithm that generates a sequence of instructions with which we can perform a specific task. Of course current programs not only perform one, but many tasks thanks to having many of these algorithms in their programming code, each one for a specific function.

We can understand this with a simple analogy of toasting bread in the morning:

  • The operating system will be our home or the room where we are, which provides the means to execute the task. The program will be the task that we want to perform, that of toasting the panel. The processes will be the different tasks that we will have to do until we reach the solution: open the bread -> plug in the toaster -> place the bread -> wait for it to toast -> remove it -> disconnect the toaster. We are the processor, the ones in charge of executing the sequence of tasks or processes.

What's in a process: threads

Double-thread execution

A process can also be divided into different parts to see how it runs on our computer. Within it we have what we call instructions, which correspond to each of the steps we must do to complete that task.

In addition, to separate each process, the processor assigns a program counter, so that each one is separate and well differentiated from another that can even be the same, for example, open the browser twice. In this way each process is saved in different registers, with different variables and of course in a different region of RAM.

It is at this point, is where the concept of processing threads or threads appears. As we know, current systems allow you to run several programs simultaneously, and consequently, we will have a large number of active processes in the system, we say they are multithreading. Each process is then divided into one or more threads or threads. Each thread has its own instructions and a state of execution, that is, values ​​in the registers with which the processor knows what phase they are in.

Continuing with the simile of toasting bread, we could understand this in the following way:

  • Looking at the process of waiting for the bread to toast, we can divide them into several threads or threads, for example, breaking the bread into two pieces and taking advantage of the two slots in the toaster. Or eat a piece while we toast the other. Each piece will be more or less toasted, and that will be its state of execution, we, the processor, must be aware that it does not burn.

Check out this article to know more about what are the threads of a processor and the difference with the cores

How a process begins and ends

The fact that computers are multithreaded systems leads us to think that obviously there will be processes that are related to each other. In the same way, one process may need the result of another to continue running. So the programs are divided into subroutines

A task that has subroutine bars must wait until they finish and give a result to continue the execution. Let's say that it will remain in a process queue with a certain counter stopped until the value of a variable activates the process again. Of course, the idea of ​​the processor will always be to finish first, the one that started first (first in - first out).

Continuing with the bread comparison, a subroutine can be to wait a countdown until the bread is toasted. The section will send us a signal to warn us to remove the bread, thus continuing with another process.

The ways to start a computer process will be as follows:

  • That we start a program or the computer itself: we trigger a forced execution by clicking on the icon or pressing a button. The system calls programs or processes: the boot loader of the hard disk will be executed and the system will begin to load processes in memory.. Or the system asks a program, for example a controller, to run.

And you can also finish:

  • Terminate the routine or the program: giving a final result that it considers correct End suddenly by an error: the routine may be badly programmed and not give the expected result From another process or switch by ourselves: we can execute a task ourselves to delete the one that is running Can be blocked: if you wait for a finished response and it does not arrive, the process will remain blocked until the system detects that it cannot continue. By a power cut

How to see kill a process in Windows

The next task we can do is to visualize the processes in the Windows operating system. This is a simple task, since we only have to right-click on the taskbar and choose the “ Task Manager ” option. A second way to do this is to press the " Ctrl + Shift + Esc " key combination. And a third will be to press the key combination " Ctrl + Alt + Del ".

In this way, we will release an application that monitors both processes and services in program execution and the operating system, as well as a hardware performance monitor. This is how we can kill or try to kill a process that is blocked.

In the processes tab we have the entire list with its activity in real time represented. We just have to select the one we want to delete and press Delete.

We can still do a little more, heading to the " performance " section and see the activity of all our main hardware. In the lower right corner, being in the " CPU " section, we will find a list of processor specifications. In it, we will see represented its cores and also its threads, threads or logical processors. In this screenshot we know that our processor has 4 threads and two cores.

And we do not stop, because now we are going to click on the option of " Open the resource monitor " to open a new application that shows us more details about the CPU and the processes. We go to the "CPU" section of this monitor and we will see a list of processes in which we also have a column that shows us all the threads or threads of each one of them.

Conclusion on a computer process

The processes have been with us since the first computers were created. It is a concept applicable to many other areas, but always with a constant, that of carrying out a series of tasks until reaching a result. It is not only about digital processes, we have made a simile with an everyday task, and also the first computers were mechanical and were already running algorithms.

We leave you with some links to tutorials that may interest you:

If you want to point out a question or have any questions about it, leave your comment in the box.

Tutorials

Editor's choice

Back to top button