自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(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 875 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 834

原创 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 3221

原创 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 2220

原创 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 1181

原创 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 10658

原创 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 1076

原创 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 923

原创 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 1899

原创 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 674

原创 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 600

原创 Concurrent Programming with Threads

a

2013-12-27 20:36:05 714

原创 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 837

原创 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 741

原创 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 702

原创 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 779

原创 Robust Buffered Reading

a

2013-12-21 11:20:10 927

原创 Robust Reading and Writing

In some situations,

2013-12-21 10:02:27 911

原创 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 733

原创 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 876

原创 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 650

原创 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 1047

原创 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 620

原创 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 603

原创 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 1068

原创 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 711

原创 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 818

原创 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 576

原创 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 1099

原创 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 561

原创 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 1025

原创 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 739

原创 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 581

原创 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 596

原创 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 742

原创 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 783

原创 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 1775

原创 Implementing a Recursive Procedure with IA32 and Y86 Assembly Code

d

2013-11-15 20:38:20 2417

原创 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 790

原创 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 604

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除