"In-depth understanding of computer systems," the study notes -01

"In-depth understanding of computer systems," the study notes -01

The original address: https://blog.csdn.net/w573719227/article/details/100182046

"In-depth understanding of computer systems (original book 3rd edition)"

In English abbreviation CS: APP

December 2017 1st edition 6th Printing

ISBN 978-7-111-54493-7

= + Context information bits

Everything bits

CSAPP opening mentions a concept: the context information bits + =

Inside the computer, " all bits of all ", all the information is stored as a binary sequence, transmission, processing and presentation, but the same binary sequence in different situations have different interpretation. Example, the same four-byte binary sequence, can be interpreted as an integer, a character can be interpreted as four ASCII code; it can be either a specific 32 machine instructions, but also can be floating-pending ......

The "read these data objects when the context " actually refers to the time of the binary sequences are presented particular context , the value is to be treated, or instructions to be executed, or whether the character is to be transmitted, "information" significance does not depend on the binary sequence itself look like, and more depend on it to be interpreted under what circumstances.

Text and binary files

There are at page 2 CSAPP a judgment is "only ASCII characters from the file is referred to as a text file , all other files are called binary file ." This argument is very interesting, in theory, all the internal computer files should be "binary", but just pull out a "text file" live apart.

When there is time before the program sometimes surprised to read / write to the file mode is a "binary format read / write", why migraine is "binary format" mean? See CSAPP relevant discussion when suddenly blessing to the soul, in fact, the information inside the computer memory is generally divided into two types: one is the posters, that is, text information; one is to look at the machine, ie, binary information.

Information to be represented on posters, it will certainly be presented in the form of a character, is not limited to ASCII character codes, GBK, Unicode these are OK, but it must be a character encoding, because for people with a string of binary sequence and no intuitive sense to people is to get the information therein only when these sequences can in turn be interpreted as a continuous character. The communication between machines is not, is the binary language of the machine is the machine word, they do not have presents to humans, do not have to further convert waste more time and space, efficient and accurate.

Not so much inside the computer files into "Text File" and "binary", it is more internal computer file into " posters " and " to see the machine " is more apt.

Reflections on the "context" of

Not surprisingly, then, reference in this section corresponding to a context should be English context, but here there is a question: "Context" is a kind of suspect term abuse within the current field of computer. As long as there has been this context the word, just - we regard it translated as "context." But in fact the use of Chinese as the Chinese people should be aware that in many places the word appears in context, it is translated as "situation", "background" or even "context" than translated as "context" better and more accurate .

For example, the following sentence:

In the context of AI, the brain is essentially an advanced piece of technology that we must study, reverse engineer, and learn to emulate.

Translation:

And in the disciplines of artificial intelligence, the brain is a kind of esoteric nature of complex technology, we need to study it, it works to resolve and mechanisms through reverse engineering, to mimic its function.

Clearly better than translated as:

In the context of artificial intelligence, the brain is a kind of esoteric nature of complex technology, we need to study it, it works to resolve and mechanisms through reverse engineering, to mimic its function.

More appropriate and fluent.

Of course, there may be "context" here is later called "the status of all the information needed to process operation" refers specifically, which of course can also be explained through; but private thought translated as "context" in the computer field context the abuse also needs to be taken seriously and promptly corrected.

Build system

This section just want to try to force mermaid drawing functions added

graph LR A [Preprocessor] B [compiler] C [Assembler] D [Linker] a {hello.c} d {hello} a -> A A - "hello.i" -> B B - "hello.s" -> C C - "hello.o" -> D D -> d

Hardware composition

1. Bus

Note that the distinction between "word (Word)" and "byte (byte)."

A "word" may contain more bytes, "length" that is the number of bytes in a word. The specific size of the word processor should be related to the number of bits.

2. I / O device

Also a hard disk I / O device, but the main memory (i.e., memory) is not. (Doubtful)

Network may be abstracted as I / O device

I / O devices and it can be abstracted as "file"

The difference between "controller" and "adapter"

I / O devices via a controller or adapter is connected to the I / O bus

  • Controller: an I / O device itself or chipset on a system board
  • Adapter: a plug on the motherboard card slot

3. main memory

Temporary storage device

A dynamic random access memory chips (DRAM, Dynamic Random Access Memory) composed of

4. Processor

  • Instruction set architecture: describes the performance of each machine code instruction

  • Microarchitecture: a processor actual implementation

As I understand it, microarchitecture probably refers to a specific processor semiconductors result, I do not know right. Doubt here.

Memory Hierarchy

A cache memory (cache memory)

Using the principle of locality , to optimize the operating speed of a high speed memory contents of the memory by a low local loading, the final overall speed of a computer to optimize the effect.

Points

  • Learn to use cache memory, can greatly enhance the performance of the program

  • Storage hierarchy abstraction layer by layer, for low-speed devices with high-speed devices communicate directly equivalent to the corresponding cache

operating system

basic skills

  1. Prevent the application from the hardware is out of control abuse;
  2. To provide a simple and consistent mechanism for applications to control complex and very different from the usual low-level hardware devices.

Three important abstract

  1. file
  2. Virtual Memory
  3. process

In addition, there is a "virtual machine" in the abstract, is to the entire system

Computer science course is one of the most important and most successful concept;

Abstract too.

Amdahl's Law

To significantly speed up the whole system, the whole system must be raised in a large part of the rate.

Concurrent and Parallel

In this book, although given concurrency (concurrency) and parallel (parallelism) concept, but the difference between the two is obvious, even after reading more confusing than not to see.

the difference

According to previous understanding, from the point of view of English words, concurrent (concurrency) prefix "con-" to emphasize that the whole word is "simultaneous" means, but does not emphasize the same time, but also because the existence of the state. For example, while watching "in-depth understanding of computer systems" and "Computer networks: top-down approach," two books, you can see today, the former 20, the latter see tomorrow 20; see also this morning, the former 20, this afternoon to see 20 the latter, however, before I read the two books, I have two books on the state of "reading" state "to see two books," it has always been there, although I have not been I see the same book, but I have been "watching" two books. Several states exist, allowing the alternate, but at the same time only one active state, which is called "concurrent."

The parallel (parallelism) prefix "para-" is "beside" Meaning, that behavior is occurring at the same time, the emphasis is the same moment . To read a book, for example, can not be my own person while watching the two books, but there should be another person next to me reading a book with me, I see "in-depth understanding of computer systems," and he saw "a computer network: from top-down approach. " Any time observed during this period, two people are looking at their own book, without disturbing each other, go hand in hand . In fact, the "hand in hand" is the "parallel" concept eye problems, but also its essence. Several states exist, the same time to remain active, which is called "parallel."

Of course, after reading CSAPP understand their feeling before it seems to have some biases, and are therefore temporarily doubtful.

Hyper-Threading

Two days ago to see someone to discuss issues of Hyper-Threading, but was not yet begun to read, and therefore not very clear concepts, it does not participate in the discussion in the study group; after reading for Hyper-Threading also have some ideas, so write it down to for reference.

Hyper-Threading and multi-threading is not the same. Case of multi-core processing goes without saying that a plurality of processors in parallel with each other. In the case of single-core, multi-threaded actually a concurrent execution time allocated to each thread by scheduling CPU time, multi-round-robin order create a "multi-threaded parallel" illusion. Hyper-Threading is to take full advantage of the extra CPU resources when performing a thread, without affecting the current thread to open a thread used is idle resources; and competition for resources occurs once, hyper-threading will termination. That "Hyper-Threading" when it occurs, is the "parallel" in the true sense.

Or example.

Multithreading is like "Naruto" in two places at once learning shadow ninja, ninja need to move between the various high-speed services, and constantly follow each transaction on a state of illusion to achieve a "cloned appears." But in fact or just a ninja, ninja need to do everything because all the resources invested, will not be able to share out the resources.

Hyper-Threading is like a man with a book feet, a person does not look at another book at the same time in the case of reading a book, because the brain, the eyes have to handle, however; this does not prevent while reading his feet, because the feet do not need to occupy the resources of the brain and eye, and foot when reading this resource is just the idle state. That is doing a task without having to put all the resources of time, after the necessary resources allocated out of the remaining resources can also support other tasks, and other tasks nor will it interfere with the current task, then this is two or several tasks can be performed simultaneously, hand in hand. As a result, the performance gains Hyper-Threading performance is far better to bring multi-core processing, because Hyper-Threading, the size is not the equivalent of multiple tasks, there is no "double performance increase" phenomenon .

Guess you like

Origin www.cnblogs.com/lierchao/p/11441971.html