Skip to Content
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
Explore Skills
Cloud Computing
Microsoft Azure
Amazon Web Services (AWS)
Google Cloud
Cloud Migration
Cloud Deployment
Cloud Platforms
Data Engineering
Data Warehouse
SQL
Apache Spark
Microsoft SQL Server
MySQL
Kafka
Data Lake
Streaming & Messaging
NoSQL Databases
Relational Databases
Data Science
Pandas
R
MATLAB
SAS
D3
Power BI
Tableau
Statistics
Exploratory Data Analysis
Data Visualization
AI & ML
Generative AI
Machine Learning
Artificial Intelligence (AI)
Deep Learning
Reinforcement Learning
Natural Language Processing
TensorFlow
Scikit-Learn
Hyperparameter Tuning
MLOps
Programming Languages
Java
JavaScript
Spring
Python
Go
C#
C++
C
Swift
Rust
Functional Programming
Software Architecture
Object-Oriented
Distributed Systems
Domain-Driven Design
Architectural Patterns
IT/Ops
Kubernetes
Docker
GitHub
Terraform
Continuous Delivery
Continuous Integration
Database Administration
Computer Networking
Operating Systems
IT Certifications
Security
Network Security
Application Security
Incident Response
Zero Trust Model
Disaster Recovery
Penetration Testing / Ethical Hacking
Governance
Malware
Security Architecture
Security Engineering
Security Certifications
Design
Web Design
Graphic Design
Interaction Design
Film & Video
User Experience (UX)
Design Process
Design Tools
Business
Agile
Project Management
Product Management
Marketing
Human Resources
Finance
Team Management
Business Strategy
Digital Transformation
Organizational Leadership
Soft Skills
Professional Communication
Emotional Intelligence
Presentation Skills
Innovation
Critical Thinking
Public Speaking
Collaboration
Personal Productivity
Confidence / Motivation
Features
All features
Verifiable skills
AI Academy
Courses
Certifications
Interactive learning
Live events
Superstreams
Answers
Insights reporting
Radar Blog
Buy Courses
Plans
Sign In
Try Now
O'Reilly Platform
book
LINUX系統程式設計 第二版
by
Robert Love
December 2013
Intermediate to advanced
496 pages
8h 57m
Chinese
GoTop Information, Inc.
Content preview from
LINUX系統程式設計 第二版
148
|
第五章
在單執行緒的行程中,行程就是執行緒,具有虛擬記憶體的一個實例以及一個虛擬處理
器。在多執行緒的行程中,具有多個執行緒。因為虛擬記憶體與行程有關,所有執行緒
共享相同的記憶體位址空間。
行程識別碼
每個行程都可以被表示成一個獨一無二的識別碼,也就是
行程識別碼
(
process ID
,常
簡寫成
pid
)。在任何單一時間點上,可以保證
pid
是獨一無二的。也就是,儘管在時間
t
0
只能有一個行程具有
pid 770
(如果所有行程中有任何行程具有這一個值),但是無
法保證在時間
t
1
不會存在一個不同的行程具有
pid 770
。然而,基本上,多數程式會假
設,核心不會輕易發出相同的行程識別碼—這個假設,正如你稍後將會看到的,相當安
全。當然,從行程的觀點來看,它的
pid
未曾改變過。
閒置行程
(
idle process
)—沒有其他可運行之行程時,核心會「運行」(
run
)此行程—
具有
pid 0
。系統開機後核心所執行的第一個行程,稱為
初始行程
(
init process
),具有
pid 1
。
Linux
上的初始行程一般就是
init
程式。我們通常會以「
init
」這個術語來指稱核
心所運行的初始行程,以及用於該目的之特殊程式。
除非用戶有明確告訴核心要執行哪些行程(透過
init
核心命令列參數),否則核心就必
須自己找出一個合適的
init
行程—這是一個罕見的例子,由核心決定方針(
policy
)。
Linux
核心將以下面的順序嘗試四個可執行檔:
1.
/sbin/init
:首選和最有可能擺放
init
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial
You might also like
優雅的SciPy|Python科學研究的美學
Juan Nunez-Iglesias, Stéfan van der Walt, Harriet Dashnow
成為卓越程式設計師的38項必修法則
Pete Goodliffe
深入理解運算原理|從簡單的機器到無所不能的程式
Tom Stuart
C++语言导学(原书第2版)
本贾尼 斯特劳斯特鲁普
Publisher Resources
ISBN: 9789862769812