没有合适的资源?快使用搜索试试~ 我知道了~
首页程序员视角:《计算机系统》第三版详解
程序员视角:《计算机系统》第三版详解
需积分: 9 42 下载量 117 浏览量
更新于2024-07-18
1
收藏 35.97MB PDF 举报
《计算机系统:程序员视角,第三版》(Computer Systems: A Programmer's Perspective, 3rd Edition) 是一本由Randal E. Bryant和David R. O'Hallaron合著的专业计算机科学教材,两位作者均来自卡内基梅隆大学。这本书从程序员的角度出发,深入探讨了计算机系统的各个方面,旨在帮助读者理解计算机的工作原理、架构以及编程中的核心概念。 在第三版中,作者们对前两版的内容进行了更新和扩展,涵盖了最新的技术和理论发展。书中可能包括计算机体系结构的基础知识,如处理器设计、内存管理、操作系统原理、并发与同步、网络通信、数据存储系统以及编程语言和编译原理等。此外,还会涉及现代计算机系统面临的挑战,如云计算、大数据、人工智能和安全问题。 对于读者来说,本书不仅提供了一种理论框架,还提供了实际编程应用中的实用指导,有助于提升他们的软件开发技能和系统设计理解。它可能采用清晰的示例和案例分析,使抽象的概念易于理解,并鼓励读者通过实践来深化学习。 在出版方面,该书由Pearson公司发行,全球范围内有广泛的发行渠道,包括美国的波士顿、哥伦布、霍博肯、印第安纳波利斯等地,以及全球其他主要城市。出版社内部团队协作紧密,包括编辑、营销经理、产品经理等多个角色,确保了教材的质量控制和市场推广。 《计算机系统:程序员视角,第三版》是一本既具有学术深度又注重实践的计算机科学入门和进阶读物,适合计算机专业学生、工程师以及对系统底层工作原理感兴趣的开发者阅读。通过阅读这本书,读者将能获得全面而深入的计算机系统知识,为他们的职业生涯打下坚实的基础。
资源详情
资源推荐
![](https://csdnimg.cn/release/download_crawler_static/10753406/bg10.jpg)
11
Network Programming
917
11.l
The Client-Server Programming M9del
918
11.2 Networks 919
11.3 The Global IP Inten;iet
924
11.3.1 IP .:\dc!resses
925
11.3.2 Internet Domain N'ames
927
11.3.3 Internet Connections 929
11.4 The Sockets Interface 932
11.4.1 Socket Addre,ss Structures
933
11.4.2 The
socket
Function 934
11.4.3 The
connect
Function 934
11.4.4 The
bind
Function 935
r
·~
f
11.4.5 The
listen
Function
93~
r .
11.4.6 The acc-:pt Function 936
11.4.7
Host
and Service Conversion 937
£ I
11.4.8 Helper Functions for the
Socket~
Ip.terface 942
11.4.9 Example Echo Client and Server ·944
11.S Web Servers 948
11.5.1 Web Basics 948
11.5.7 Web Content 949
11.5.3
HTIP
Transactions 950
11.5.4 Serving Dynamic Content 953
11.6 Putting
It
Together: The
TINY
Web Server 956
11.7 Summary
964
Bibliographic Notes
965
Homework Problems 965
Solutions to Practice Problems 966
12
Concurrent Programming
971
12.l
Concurrent Programming with Processes
973
12.1.1 A Concurrent Server Based on Processes 974
12.1.2 Pros and Cons
of
Processes 975
12.2 Concurrent Programming with I/O Multiplexing
977
12.2.l A Concurrent Event-Driven Server Based on I/O
Multiplexing 980
12.2.2 Pros and Cons of I/O Multiplexing 985
12.3 Concurrent Programming with Threads 985
12.3.l Thread Execution Model 986
Contents xvii
![](https://csdnimg.cn/release/download_crawler_static/10753406/bg11.jpg)
xviii Contents
12.3.2 Posix Threads
987
12.3.3 Creating Threads
988
12.3.4 Terminating Threads
988
12.3.5 Reaping Terminated Threads
9~9
12.3.6 Detaching Threads
989
12.3.7 Initializing Threads 990
12.3.8 A Concurrent Server Based on Threads
9~1
12.4 Shared Variables in Threaded Programs 992
12.4.1 Threads Memory Model
993
12.5
12.4.2 Mapping Variables to Memory
994
12.4.3 Shared Variables
995
Synchronizing Threads with Semaphores
995
12.5.1 Progress Graphs
999
12.5.2 Semaphores
1001
12.5.3 Using Semaphores for Mutual Exclusion lp02
12.5.4 Using Semaphores to Scqedule Shared Respurces. 1004
12.5.5 Putting
It
Together: A Concurrent Server Based on
12.6
12.7
Prethreading 1008
Using
Threads for Parallelism 1013
Other
Concurrency Issues 1020
12.7.1 Thread Safety 1020
12.7.2 Reentrancy
1023
"
12.7.3 Using Existing Library Functions in Threaded Programs
12.7.4 Races
1025
12.7.5 Deadlocks 1027
12.8 Summary 1030
A
Bibliographic Notes 1030
Homework Problems
1031
Solutions to Practice Problems 1036
Error Handling
1041:
A.1
Error
Handling in Unix Systems 1042
A.2
Error-Handling Wrappers 1043
References 1047
Index 1053
-
1024
![](https://csdnimg.cn/release/download_crawler_static/10753406/bg12.jpg)
Preface
This
book
(known as CS:APP)
is
for computer scientists, computer engineers, and
others who want to be able to write
better
programs by learning what is going
on
"under the hood'" of.a computer systefn.
Our
aim'is to explain
the
enduring concepts underlying all computer systenls,
and to show you the cohcrete ways that
these
ideas affect
the
correctn'ess;perfSr-
mance,'lmd
utility
of
your
application programs.'Mlmy systems
bob
ks are
1
\vritten
from a
builder's perspective, describing how to implement the hardware
or
th'e sys-
tems software,
inC!uding the operating system, compiler, and network·iiltefface.
Thisbook
is
wrihen from"a progr'dmme""' pefspective,'describing how application
programmers can use
their knowledge
of
a system to write
better
programs.
'Of
course, learning what a system
i§
supposed to do provide&.a good first step
in
learn-
ing how to
build one,'so this book also serves as
a·
valuable introduction to those
who go on to iinplemeht systems hardware and soffware. Most systems books also
tend to focus on just one aspect
of
the system, for example, the•hardware archi-
tecture: the operating system, the compiler,
or
the "network. Tiiis book" spans all
of·these aspects,' with !lie unifying theme
of
a progranfmer's perspective.
If
you·study
ancl-learh>.the-concepts-in-this-!:mok~you-.wiU1:le"on·yoni-wzj>'tcr--
-
becoming the
'rare
power
progranimer'who knows how things
work'and
how
io
fix
them when tbey'bteak. You will· be able to write programs that·make•better
use of the'caP,abiij(ies provided by theloperating systeni'and systellis software,
that operate 'correctly across'1i
wicte'
range
of
operating conditibhs and
run'.-t:llne
parameters,' that
run
faster, and
that
avoid the flaws
that
make·ptogramS vu!Iler-
able
t'6
cybefatt'ack-. You will
be
prepared to delve
deeper
into 'advanced topics
sucn
as
conipilers;'c6mputer architecture, 'operating
sy~tems,
embedded systems,
networking, and cybersecurity.
Assumptions'
abou't
the
Reader's
Backgrourid "
This book focuses on systems that execute x86-64 machine code. x86-64
is
the latest
in an evolutionary
path
followed by Intel and its competitors .that started with the
8086
microprocessor in 1978.
Due
to the naming conventions used by Intel for
its microprocessor line, this class
of
microprocessors
is
referr~d
tq coll9ql'ially as
"x86."
As
semiconductor technology has evolved to allow more transistors to
be
integrated onto a single. chip, these processors have progressed greatly in their
computing.ppwer. and theii:.mel)lory capacity. 'As.part
of,
this ptogression, (hey
have gone from pp,erating on· 16-bit
'XQW,
to.32-bit.words with the; introduction
of IA32 processors, and most recently to 64-bit words with x86-64.
We
consider how these machines execute C programs on Linux. Linux is.one
~
of a
number·of
operating systems·having their heritage in the Unix operating
system developed originally by Bell Laboratories.
Other
members-of this class
xix
![](https://csdnimg.cn/release/download_crawler_static/10753406/bg13.jpg)
xx
Preface
l
I
II
t
of
operating systems include Solaris, FreeBSD, and MacOS X.
In
recent years,
these operating systems have maintained a high level of compatibility through the
efforts
of
the Posix and Standard Unix Specification standardization efforts. Thus,
the material in this book applies almost directly to these
"Unix-like" operating
systems.
The, text contains numerous programming examples that have been compiled
and run
on
Linux systems.
We
assume that you have access to such a machine, and
are able to log in and do simple things such as listing files and changing directo-
ries.
If
your computer runs Microsoft Windows, we recommend that you install
one
of
the many different virtual machine environments (such
as
Virtua!Box
or
VMWare) that allow programs written for one operating system (the guest OS)
to run under another (the host OS).
We
also assume that you have some familiarity with C
or
C++.
If
your only
prior experience is with Java, the transition will require more effort
on
your part,
but we will help you. Java and C share similar syntax and control statements.
However, there are aspects of C (particularly pointers, explicit dynamic memory
allocation, and formatted
I/O) that do not exist in Java. Fortunately, C
is
a small
language, and it
is
clearly and beautifully described in the classic "K&R" text
by
J?rian Kernighan and Dennis Ritchie
[61].
Regardless
of
your programming
background, consider
K&R
an essential part of your personal systems library.
If
your prior experience
\s
with an interpreted language, such as Python, Ruby, or
Perl, you will definitely want to devote some
ti_me
to learning C before you attempt
to
use this book.
Several
of
the early chapters in the book explore the interactions between C
programs and their machine-language counterparts. The machine-language exam-
ples were all generated by the
GNU ace compiler running on x86-64 processors.
We do
not
assume any prior experience with hardware, machine language, or
assembly-language programming.
How
to
Read
the
Book
Learning how computer systems work from a programmer's perspective
is
great
fun, mainly because you can do it actively. Whenever you learn somethihg
new,
you can try it out right away and see the result firsthand.
In
fact, we believe that
the only way
to
learn systems
is
to do systems, either working concrete problems
or
writing and running programs
on
real systems.
This theme pervades the entire book. When a new concept
is
introduced, it
is
followed in the text by one
or
more practice problems that you should work
![](https://csdnimg.cn/release/download_crawler_static/10753406/bg14.jpg)
--~·
~·
------'----------~-'---'code!intro/hello.c
1'
#include
<st!dio.h>
2
3
int
main()
4 {
5
printf("hello,
world\n");
6
return
O;
7 }
-------------~----------
code/introlhel/o.c
Figure 1 A typical
code
exqmple.
immeC!iately to test your understanding. Solutions t6 the practice problems are
at the end of each
chapter. As you read, try to solve each problem on your own
and then check the solution
to
make sure you are
on
the
rigll.t
track.
Each
chapter
is
fallowed by a s6t
of
homework problems of varying difficulty. Your instructor
has the solutiohs to \he h6mework p1ob!ems in
an
instructor's manual.
For
each
homew9rk problem, we
show a rating
6f
the amount of effort we feel it will require:
' '
+ Should require just a few
min~t~s.
Little
or
no
programming required.
~
•
~
•
.1
•
~,t
MighVygui,re
up,
to 20 mip.utes. Often il)volves
Wfili.i;ig.and
,t,esting some
code. (Many
of
these,arq'flerived from pn1blems.we
ha,ve
given
on
exams.)
+++
Requires a sjgnificant;,effort
1
perhaps1-2
hours. Generally in\lolves writ-
ing and testing a significant amount
of
code ..
++++
A lab assignment, requiring up to 10 hours
of
effort.
Each
eode example in the
te;t
was formatted directly, Without any manual
intervention, from a C program compile<i":ith
clC<;
and' tested on a
Lin
ID:·
system.
of"course, your system may have a different version
of
ace,
or
a different compiler
• ' '
'<}
altogether, so your compiler might generate different \fiachme code;
but
the
overall behavior should
be
the same.
All
bf
the.source code!i§' available from the
CS:APP Web page ("CS:APP" being our
shorthahd
fot
146
book's title)
at
csapp
.cs.cmu.edu.
In
the text, the filenarlies
6f
the so'urce progrAhts
are
docuinented
in
horizont111
bars
that
sutround the formatted code.
For
example; the program
in
Figure' I can
be
found in the file
hello.
c in directory code"f
intro/.
We encourage
yoli1o try rurming the example programs
on
your system
as
you encounter them.
To avoid.having a.book
that
is overwhelming,
both
irrbulk and in content, we
have:cre'ated•a'number of.w.rb asides containing matetial that.supplements the
main presentatioh
of1ha
boolo.,These asides are referenced!Within the
book
with
a notation'of the form
CHAE:TOP,
where
CHAP
is
ashoi;~
encoding
of
the chapter sub-
·iect,
and
TOPds.a
shott-cocje·fonthe topic-that is covered.·For example, Web Aside
DATK.BOOL
contains supplementary material on·Booleanalgebra for the presenta-
tion
on
data representations in Chapter 2, while Web Aside
ARCH:VLOG
contains
Preface
,xxi
剩余1119页未读,继续阅读
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![-](https://img-home.csdnimg.cn/images/20210720083327.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://profile-avatar.csdnimg.cn/d5ac3e845e6b410091169f5df13165cd_noryes.jpg!1)
noryes
- 粉丝: 10
- 资源: 2
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![](https://csdnimg.cn/release/wenkucmsfe/public/img/voice.245cc511.png)
最新资源
- 贵州煤矿矿井水分类与处理策略:悬浮物、酸性与非酸性
- 醛固酮增多症肾上腺静脉采样对比:ACTH后LR-CAV的最优评估
- 开源云连接传感器监控平台:农业土壤湿度远程监测
- 母婴用品企业年度生产计划线性规划优化模型:实证与应用
- 井下智能变电站:Rogowski线圈电流检测系统的研发与性能验证
- 霍州矿区煤巷稳定性分析及支护策略
- ARM嵌入式系统远程软件更新方案:基于TFTP协议
- 煤炭选煤中汞分布规律与洗选脱汞效果
- 提升码垛机器人性能:拉格朗日动力学模型与滑模模糊控制的应用
- 增强现实技术提升学前手写教学:设计与开发案例
- 不规则工作面沉陷三角剖分算法提升与应用
- 卡尔曼滤波在瞬变电磁干扰压制中的应用研究
- 煤矿安全能力研究:理论与系统构建
- LonWorks总线技术在斜巷运输车辆定位与跑车防护中的应用
- 神东煤炭集团高效煤粉锅炉系统:节能环保新实践
- Ti/SnO2+Sb2Ox/PbO2电极分形维数与电催化性能研究
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035711.png)
![](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![](https://csdnimg.cn/release/wenkucmsfe/public/img/green-success.6a4acb44.png)