- Mastering Linux Kernel Development
- Raghu Bharadwaj
- 169字
- 2021-07-08 09:47:14
pid
This field contains a unique process identifier referred to as PID. PIDs in Linux are of the type pid_t (integer). Though a PID is an integer, the default maximum number PIDs is 32,768 specified through the /proc/sys/kernel/pid_max interface. The value in this file can be set to any value up to 222 (PID_MAX_LIMIT, approximately 4 million).
To manage PIDs, the kernel uses a bitmap. This bitmap allows the kernel to keep track of PIDs in use and assign a unique PID for new processes. Each PID is identified by a bit in the PID bitmap; the value of a PID is determined from the position of its corresponding bit. Bits with value 1 in the bitmap indicate that the corresponding PIDs are in use, and those with value 0 indicate free PIDs. Whenever the kernel needs to assign a unique PID, it looks for the first unset bit and sets it to 1, and conversely to free a PID, it toggles the corresponding bit from 1 to 0.
- 數(shù)據(jù)庫系統(tǒng)教程(第2版)
- .NET 4.0面向?qū)ο缶幊搪劊夯A(chǔ)篇
- C語言程序設(shè)計(jì)
- Python 3網(wǎng)絡(luò)爬蟲實(shí)戰(zhàn)
- Learning Laravel's Eloquent
- Python深度學(xué)習(xí):模型、方法與實(shí)現(xiàn)
- Linux Shell核心編程指南
- Practical Game Design with Unity and Playmaker
- 響應(yīng)式Web設(shè)計(jì):HTML5和CSS3實(shí)戰(zhàn)(第2版)
- Couchbase Essentials
- Building Serverless Architectures
- Java EE 7 with GlassFish 4 Application Server
- Apache Solr PHP Integration
- Learning Unreal Engine Game Development
- Xamarin Cross-Platform Development Cookbook