What would be a PID?

Asked

Viewed 6,958 times

7

I’m starting to study desktop applications. I had a certain question about how I could know if a particular application is running and I was told that I could use the PID, as a solution, to detect this.

I usually work with operating system Linux and, as I understand it, it seems to me to be an ID of a process. That would be it?

I wanted to know a little more details:

  • What would be the PID?

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

  • That one PID is Linux thing or other operating systems use? I mean, that’s a default name or something adopted by Linux?

  • 2

    PID is the process id and is used by the operating system. Each process has a different id.

  • 2

    In windows is also used, if you type tasklist in cmd it brings the running processes: https://i.stack.Imgur.com/Fp4x0.png the second line being the PID

1 answer

9


What would be the PID?

The PID means Process IDentification.

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

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

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 the C language, which allows you to create a new process and continue the execution from the point the function was called. When calling this function, a new PID is generated.

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

PID is a default name adopted in all operating systems.As far as I know all operating systems assign Pids to existing processes, generally PID 1 is assigned to a special process called init.

In Windows 10 you can see the PID of the processes by 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.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.