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系統程式設計 第二版
202
|
第六章
cpu = CPU_ISSET (i, &set);
printf ("cpu=%i is %s\n", i,
cpu ? "set" : "unset");
}
一如往常,首先我們會使用
CPU_ZERO
把
set
清為零。然後我們會使用
CPU_SET
設定
CPU
#0
以及使用
CPU_CLR
清除
CPU #1
。
CPU_CLR
操作是多餘的,因為我們剛剛已經把整個
set
清為零,這麼做只是為了完整性。
在這個具有兩個處理器的系統上執行此程式會產生與之前稍微不同的輸出:
cpu=0 is set
cpu=1 is unset
cpu=2 is unset
...
cpu=1023 is unset
現在,
CPU #1
會被清除。此行程只會運行在
CPU #0
之上。
errno
有四個可能值:
EFAULT
所提供的指標超出了行程之位址空間的範圍或者無效。
EINVAL
此狀況下,
set
中並未啟用系統上的實體處理器(僅適用於
sched_setaffinity()
),
或是
setsize
小於核心之內部資料結構(用於表示處理器之設定)的大小。
EPERM
進行叫用之行程當前的有效用戶識別碼並未擁有
pid
所指定的行程,而且該行程並
不具備
CAP_SYS_NICE
的能力。
ESRCH
找不到
pid
所指定的行程。
即時系統
在計算機領域,
即時
(
real-time
)這個術語往往是一些混亂和誤解的源頭。一個即時系
統必須滿足
操作期限
(
operational deadline
);也就是,事件發生之後,必須在預定時間
之內做出回應。一個常見的即時系統就是幾乎所有現代汽車之上都可以找到的 ...
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