Is it possible for an app to have several PID at the same time?

Asked
Active3 hr before
Viewed126 times

5 Answers

possible
90%

Accounting information - user and kernel CPU time consumed, account numbers, limits, etc.,Modern systems allow a single process to have multiple threads of execution, which execute concurrently. Threads are covered extensively in the next chapter. ,Ready - The process has all the resources available that it needs to run, but the CPU is not currently working on this process's instructions.,The inability of the system to deliver necessary system resources.

            int exitCode;
            exit(exitCode); // return exitCode; has the same effect when executed from main( )
load more v
88%

In most cases, every Android application runs in its own Linux process. This process is created for the application when some of its code needs to be run, and will remain running until it is no longer needed and the system needs to reclaim its memory for use by other applications.,Explain access to more sensitive information,Security with data across additional Android versions,Supporting controllers across Android versions

An unusual and fundamental feature of Android is that an application process's lifetime is not directly controlled by the application itself. Instead, it is determined by the system through a combination of the parts of the application that the system knows are running, how important these things are to the user, and how much overall memory is available in the system.

It is important that application developers understand how different application components (in particular Activity, Service, and BroadcastReceiver) impact the lifetime of the application's process. Not using these components correctly can result in the system killing the application's process while it is doing important work.

Activity

An unusual and fundamental feature of Android is that an application process's lifetime is not directly controlled by the application itself. Instead, it is determined by the system through a combination of the parts of the application that the system knows are running, how important these things are to the user, and how much overall memory is available in the system.

It is important that application developers understand how different application components (in particular Activity, Service, and BroadcastReceiver) impact the lifetime of the application's process. Not using these components correctly can result in the system killing the application's process while it is doing important work.

Service

An unusual and fundamental feature of Android is that an application process's lifetime is not directly controlled by the application itself. Instead, it is determined by the system through a combination of the parts of the application that the system knows are running, how important these things are to the user, and how much overall memory is available in the system.

It is important that application developers understand how different application components (in particular Activity, Service, and BroadcastReceiver) impact the lifetime of the application's process. Not using these components correctly can result in the system killing the application's process while it is doing important work.

BroadcastReceiver
load more v
72%

Many things will remain the same (including the process ID, parent process ID, and file descriptors) with the exception of file descriptors that had the FD_CLOEXEC flag set using fcntl(). See the exec*() functions for more on what will and will not be the same across the exec. , As mentioned above, you can run dumper so that when a process dies, dumper writes the state of the process to a file. ,Reading and writing the process's address space, When a process dies by calling exit(), “normal exit processing” happens. This includes:

kill(pid, SIGTERM);
65%

Use the shell GDB command to run the ps command and find the program’s process id (pid): , Use the shell GDB command to run the ps command and find the program’s process id (pid): (gdb) shell ps -C program -o pid h pid Replace program with a file name or path to the program. , Replace program with a file name or path to the program. , Replace program with a file name or path to the program.

To enable the creation of debugging information with GCC when compiling and linking code, use the -g option:

$ gcc...-g...

The GCC manual page:

$ man gcc
load more v
75%

At any point of time, no two processes with the same pid exist in the system because it is the pid that Unix uses to track each process. ,CMD: The command that started this process,top: This command is used to show all the running processes within the working environment of Linux. Syntax:  ,PPID: Parent process ID (the ID of the process that started it)

Method 1: Foreground Process : Every process when started runs in foreground by default, receives input from the keyboard, and sends output to the screen.  When issuing pwd command 

$ ls pwd
load more v

Other "possible-undefined" queries related to "Is it possible for an app to have several PID at the same time?"