Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Is there just one PID for an application and the services it loads

Posted on 2013-11-08
1
Medium Priority
?
292 Views
Last Modified: 2013-11-16
Hi,

I have an android application that loads three services.  The application itself runs in the background with the three services.  I am wanting to do some CPU usage measures for the application and the three services.  I had placed the code that gathers the metrics that I am using in one of the services.  It occurred to me that the PID that I am getting me only be for the service.  I was hoping someone might know exactly how this works.  Does the application and the three services each have there own PID or is there one PID shared between the application and the services?  If I have not given enough information to answer this question, let me know and I will do what I can to supply more info.

Thanks
0
Comment
Question by:DLAtkinson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 79

Accepted Solution

by:
arnold earned 2000 total points
ID: 39635212
Not a specific answer to android, usually.
Each application at the time of running has a unique ProcessID. When it exits and after enough time has passed, the PID numbers are reused..
The PID is assigned by the system.
As to your question, a process starts and gets a process ID of 1234 it then starts three additional services/processes 2345, 2346, and 2347
The parent process ID (PPID) of each of these three will be 1234.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The case of the missing phone talks about the way a small electronic gadget (the mobile phone) has penetrated into our lives and has made us addicted to it.
There is a lot to be said for protecting yourself and your accounts with 2 factor authentication.  I found to my own chagrin, that there is a big downside as well.
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question