android pid uid tid 的区别
Tid(thead id)
- 可以理解为线程的Id:
- Application中拿到主线程的Tid。android.os.Process.myTid();
PID:
- 进程id,一个pid对应一个进程,每次杀死进程,再重新启动程序,系统都会赋予一个新的pid,一般情况下一个应用程序对应一个pid,但一个应用程序也可以有多个pid;
Uid
- UID在linux中就是用户的ID,表明时哪个用户运行了这个程序,主要用于权限的管理。而在android 中又有所不同,因为android为单用户系统,这时UID 便被赋予了新的使命,数据共享,为了实现数据共享,android为每个应用几乎都分配了不同的UID,不像传统的linux,每个用户相同就为之分配相同的UID。(当然这也就表明了一个问题,android只能时单用户系统,在设计之初就被他们的工程师给阉割了多用户),使之成了数据共享的工具。
pid = process ID
uid = user ID of the application that owns that process
gid = group IDs of the application that owns that process
pid: The is the process ID (PID) of the process you call the Process.pid method in.
ppid: The PID of the parent process (the process that spawned the current one). For example, if you run ruby test.rb in a bash shell, PPID in that process would be the PID of Bash.
uid: The UNIX ID of the user the process is running under.
euid: The effective user ID that the process is running under. The EUID determines what a program is allowed to do, based on what the user with this UID is allowed to do. Typically the same as uid, but can be different with commands like sudo.
gid: The UNIX group ID the program is running under.
egid: Like euid, but for groups.
参考