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系統程式設計 第二版
132
|
第四章
讀取檔案中的一個團塊之前,行程可以提供
POSIX_FADV_WILLNEED
建議,以便提示核心把
檔案讀取到頁面快取區。
I/O
將在背景以非同步的方式進行。當應用程式最後存取檔案
時,
I/O
操作可以順利完成而不會遭到阻擋。
反過來說,讀取或寫入許多資料後—例如,有連續的視訊串流被送往磁碟—行程可以提
供
POSIX_FADV_DONTNEED
建議,以便指示核心從頁面快取區收回檔案的特定團塊。一個大
型的串流操作會把資料不斷填入頁面快取區。如果應用程式不打算再次存取這些資料,
這意味著頁面快取區將充滿多餘的資料,而且會犧牲其他可能有用的資料。因此,對視
訊串流應用程式而言,明智的做法為,定期要求核心從快取區中逐出串流資料。
想要讀取一整個檔案的行程,可以提供
POSIX_FADV_SEQUENTIAL
建議,以便提示核心進
行積極的先讀操作。反過來說,一個行程若知道它將要隨機存取一個檔案,來回查找
資料,可以提供
POSIX_FADV_RANDOM
建議,以便提示核心先讀操作只不過是毫無價值的
開銷。
同步化、同步及非同步操作
Unix
系統大量地使用同步化(
synchronized
)、非同步化(
nonsynchronized
)、
同
步(
synchronous
)以及非同步(
asynchronous
)等令人混淆的術語—就英文而言,
「
synchronous
」與「
synchronized
」的差異並不大!
同步(
synchronous
)寫入操作會等到所寫入的資料—至少—被存入核心的緩衝快取區
(
buffer ...
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