What would a PID be?

7

I'm starting to study desktop applications. I had a question about how I could know if a particular application is running and I was told I could use PID as a solution to be able to detect this.

I usually work with Linux and, from what I understand, it seems to me to be an ID of a process. Would that be it?

I wanted to know a little more detail:

  • What would the PID be?

  • If the PID has to do with the process ID, if the same application is opened twice, will it have the same or different PID ?

  • Is this PID thing Linux or other operating systems use? I mean, is this a default name or something adopted by Linux?

asked by anonymous 22.03.2017 / 15:10

1 answer

8
  

What would the PID be?

The PID stands for P rocess ID entification.

This is a number that the kernel gives to each process to be able to identify them. It is through the PID that we can kill an application for example.

  

If the PID has to do with process identification, if the same application is opened twice, will it have the same or different PIDs?

Whenever you open a second instance of the application, it will receive a new PID. In the specific case of Linux, there is even a function called fork in language C, which allows you to create a new process and continue execution from the point the function was called. When calling this function, a new PID is generated.

  

Is this PID thing Linux or other operating systems use? I mean, is this a default name or something adopted by Linux?

The PID is a default name used in all operating systems. As far as I know all operating systems assign PIDs to existing processes, PID 1 is usually assigned to a special process called init .

In Windows 10 you can see the process PID going to the task manager in the "Details" tab.

If you do not have the PID column, right-click on any column and select the "Select Columns" option. Check the PID option.

    
22.03.2017 / 15:24