- 博客(42)
- 收藏
- 关注
原创 Routing Algorithms
The main function of the network layer is routing packets from the source machine to the destination machine. And the routing algorithm is that part of the network layer software responsible for dec
2014-03-24 11:35:12 910 1
原创 The Broadcast Channel Allocation Problem
Network links can be divided into two categories: those using point-to-point connections and those using broadcast channels. In any broadcast network, the key issue is how to determine who gets to u
2014-01-24 19:17:51 859
原创 A Utopian Simplex Protocol
We will consider a Utopian simplex data link protocol that is as simple as it can be because it does not worry about the possibility of anything going wrong. Data are transmitted in one direction on
2014-01-10 20:53:56 3255
原创 Error Detection And Correction
Communication channels have a range of characteristics. Some channels, like optical fiber in telecommunications networks, have tiny error rates so that transmission errors are a rare occurrence. But
2014-01-07 13:52:07 2262
原创 The Maximum Data Rate of a Channel
In 1924, an AT&T engineer, Henry Nyquist, realized that even a perfect channel has a finite transmission capacity. He derived an equation expressing the maximum data rate for a finite-bandwidth nois
2014-01-05 00:42:52 1215
原创 A Critique of the Models and Protocols of OSI & TCP/IP
Neither the OSI model and its protocols nor the TCP/IP model and its protocols are perfect. The criticism of the OSI model and its protocols can be summarized as: 1. Bad timing. 2
2014-01-03 09:38:42 10686
原创 A Comparison of the OSI and TCP/IP Reference Models
The OSI and TCP/IP reference models have much in common. Both are based on the concept of a stack of independent protocols. Also, the functionality of the layers is roughly similar. Despite these fu
2014-01-02 19:35:40 1105
原创 Introduction to the TCP/IP Reference Model
Regarding the reference model (not OSI) used in the grandparent of all wide area computer networks, the ARPANET, and its successor, the worldwide Internet, when satellite and radio networks were add
2014-01-02 17:14:11 944
原创 Introduction to the OSI Reference Model
The OSI model (minus the physical medium) is showed below. The model is called the OSI (Open Sytems Interconnection) reference model because it deals with connecting open systems—that is, systems th
2014-01-02 14:17:22 1934
原创 Error Handling
Programmers should always check the error codes returned by system-level functions. There are many subtle ways that things can go wrong, and it only makes sense to use the status information that th
2013-12-30 22:31:03 686
原创 Using Threads for Parallelism
Thus far in our study of concurrency, we have assumed concurrent threads executing on uniprocessor systems. However, many modern machines have multi-core processors. Concurrent programs often run fa
2013-12-30 14:33:47 621
原创 Concurrent Programming with I/O Multiplexing
Suppose you are asked to write an echo server that can also respond to interactive commands that the user types to standard input. In this case, the server must respond to two independent I/O events
2013-12-25 16:21:56 853
原创 Concurrent Programming with Processes
Applications that use application-level concurrency are known asconcurrent programs. Modern operating systems provide three basic approaches for building concurrent programs: processes, I/O multiple
2013-12-25 15:19:15 756
原创 Client and Server Code on Network Programming
The best way to learn the sockets interface is to study example code. The code for an echo client is showed below.#include #include #include int main(int argc, char **argv){ char *hostname, b
2013-12-25 10:15:37 719
原创 Sharing Files
Suppose the disk filefoobar.txt consists of the six ASCII characters "foobar". Then what is the output of the following program?int main(){ char c; int fd1 = open("foobar.txt", O_RDONLY,
2013-12-21 19:41:55 792
原创 Common Memory-Related Bugs in C Programs
Managing and using virtual memory can be a difficult and error-prone task for the C programmers. Memory-related bugs are among the most frightening because they often manifest themselves at a distan
2013-12-18 18:45:23 751
原创 Garbage Collection
A garbage collector is a dynamic storage allocator that automatically frees allocated blocks that are no longer needed by the program. We introduce Mark&Sweep garbage collectors here. A Mark&
2013-12-18 16:00:06 890
原创 Building Your Own Allocator
While it is certainly possible to use the low-levelmmap and munmap functions to create and delete areas of virtual memory, C programmers typically find it more convenient and more portable to use a
2013-12-18 15:30:32 669
原创 Using mmap to Copy an Arbitrary-sized Disk File to stdout
The low-level system callsmmap and munmap can be used to create and delete areas of virtual memory. We will write a C programmmapcopy.c that uses mmap to copy an arbitrary-sized disk file tostdo
2013-12-17 09:37:38 1062
原创 Nonlocal Jumps
C provides a form of user-level exceptional control flow, called anonlocal jump, that transfers control directly from one function to another currently executing function without having to go throug
2013-12-12 22:34:11 639
原创 Signal Handling on Exceptional Control Flow
A signal is a small message that notifies a process that an event of some type has occurred in the system. Consider the following program.#include #include "csapp.h"using namespace std;pid_t pid
2013-12-12 21:46:28 618
原创 Using waitpid to Reap Zombie Children
When a process terminates for any reason, the kernel does not remove it from the system immediately. Instead, the process is kept around in a terminated state until it is reaped by its parent. When
2013-12-11 11:32:34 1087
原创 An Application Program Dynamically Loading and Linking the Shared Library
Shared libraries are a modern innovation that address the disadvantages of static libraries. A shared library is an object module that, at run time, can be loaded at an arbitrary memory address and li
2013-12-08 09:14:54 731
原创 How Linkers Relocate Symbol References
Once the linker has completed the symbol resolution step, it has associated each symbol reference in the code with exactly one symbol definition. At this point, the linker knows the exact sizes of t
2013-12-07 08:42:11 831
原创 How Linkers Use Static Libraries to Resolve References
While static libraries are useful and essential tools, they are also a source of confusion to programmers because of the way the Unix linker uses them to resolve external references. During the symb
2013-12-06 14:15:50 589
原创 Using Blocking to Increase Temporal Locality
In the last essay Rearranging Loops to Increase Spatial Locality we saw how some simple rearrangements of the loops could increase spatial locality. But observe that even with good loop nestings,
2013-12-04 10:27:53 1117
原创 Rearranging Loops to Increase Spatial Locality
Consider the problem of multiplying a pair ofn×n matrices: C = AB. For example, if n=2, then Matrix multiply is usually implemented using three nested loops, which are identified by their
2013-12-04 09:38:59 599
原创 Writing Cache-friendly Code
In the previous essayExhibiting Good Locality in Your Programs, we presented two functions namedsumarrayrows andsumarraycols respectively. And we knew thatsumarrayrows had a stride-1 reference
2013-12-02 10:49:40 1055
原创 Conflict Misses in Direct-Mapped Caches
Conflict misses are common in real programs and can cause baffling performance problems. Conflict misses in direct-mapped caches typically occur when programs access arrays whose sizes are a power o
2013-11-28 18:12:43 761
原创 Exhibiting Good Locality in Your Programs
Well written computer programs tend to exhibit good locality. That is, they tend to reference data items that are near other recently referenced data items, or that were recently referenced themselves
2013-11-27 21:06:52 595
原创 Writing Code Suitable for Implementation with Conditional Moves
The effect of a mispredicted branch can be very high, but the branch prediction logic found in modern processors is very good at discerning regular patterns and long-term trends for the different b
2013-11-25 18:31:37 608
原创 Further Optimizations Exploiting the Microarchitecture of the Processor
In the prior essay Transforming an Abstract Program into More Efficient Code Systematically, we applied optimizations that did not rely on any features of target machine. They simply reduced the ov
2013-11-23 22:50:05 755
原创 Transforming an Abstract Program into More Efficient Code Systematically
We will use a running example based on the vector data structure from Ref. 1. The structure is declared as follows:typedef int data_t;#define IDENT 1#define OP *typedef struct { long int le
2013-11-22 22:58:42 820
原创 Two Optimization Blockers Limiting the Compiler to Generate Optimized Code
Modern compilers employ sophisticated algorithms to determine what values are computed in a program and how they are used[1]. However, compilers apply only safe optimizations to a program, and constra
2013-11-20 22:38:17 1795
原创 Assembly-Level Representation of Programs on IA32 and x86-64
Below is the C code for example.long example(long* xp, long y){ long t = *xp + y; *xp = t; return t;}
2013-11-14 14:08:11 806
原创 Bit-level Difference between Float and Double
Here is a segment of C++ code.#include "stdafx.h"#include using namespace std;int _tmain(int argc, _TCHAR* argv[]){ double sum1=0; for (double i=0.01f; i<=1.0f; i+=0.01f) { sum1 += i;
2013-11-04 21:03:12 617
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人