01 - ACID / BASE / CAP
CAP Theorem
C-onsistency
每次对系统读取返回的是最新写入的资料,否则返回错误
A-valiability
任何时候对系统发出请求时都能返回结果,不会返回错误,但系统不能保证结果是正确的
P-artition Tolerance
主系统 scale out 多个子系统,当主系统发生故障时,整个系统依旧能返回正确结果
CAP: 分布式系统中最多满足上述三个性质中的两个,所以一共有 $C_3^2 = 3$ 种搭配
Consistency + Availiability
单机系统,只要电脑不发生故障,系统就能持续工作且结果保持一致,但缺少了 Scalability
Consistency + Partition Tolerance
有 Scalability,若系统内有一个元件还未更新到最新结果,由于缺少 Availability 和需保持 Consistency,系统返回错误
应用: Distributed RDBMS 以 Consistency 为最高原则,不允许一个 Client A 在向 Server A 写入结果时,能从 Server ...
03 - DFA (Application)
Basic ConceptsData flows on CFG
In CFG, the application-specific Data(Abstraction) will flows through the Nodes(BBs/Statement), Edges(control flow), CFG(a program).
Most static analyses are may analysis:
May Analysis:
Output maybe true. (over-approximation) – 近似值也可以
Must Analysis:
Output must true. (Under-approximation) – 不想要近似值
Preliminaries of DFA
DFA(here): Data Flow Analysis
Each red point represents as a program states.
Each green filed for data-flow values.
domain: 不同的 DFA ...
02 - Intermediate Representation (IR)
Relation between compliers and static analyzersMy Answer:
After scanner, parser, type checker phases, after translator step, the complier will produce program’s intermediate presentation(IR), and static analyzers will make some operations on these IRs, which could help generator function efficiently.
Exact Answer:
3AC and its common formsMy Answer:
3AC: Three Address-Code, which expressed program’s arguments’ movements, it has following formats:
Exact Answer:
As a concrete instanc ...
01 - Intro
Differences between static analysis and (dynamic) testing?My Answer:
Static Analysis: Before compling the program, the analysis tool will detect whether the program is suitable to compile.
Dynamic Analysis: detect program whether true while compling?
Exact Answer:
Static Analysis: 运行程序 P 前,静态分析会 analyze P to reason about its behaviors 和判断 P 是否满足一些 properties:
Does P contain any private information leaks
Does P dereference any null pointers
Whether cast is safe
Can v1 and v2 in P point to t ...
Clang in VSCode
记录下配置过程,不想再每换一台机器就搜各种文档来缝缝补补好多次…
操作系统: macOS Monterey 12.2.1
Extensions 下载
Workspace Settings我学乖了,项目主要用到什么语言,就建立一个对应语言的workspace,如 C++ 的项目都放在 CPP Folder下就好,这样我们只需要建立一个 .vscode 文件夹。
.vscode 中建立四个文件:
tasks.json – 编译时加入的编译选项
settings.json – 没想清在单个项目有什么用,我一般配全局
launch.json – 用于 LLDB Debug
c_cpp_properties.json – 加头文件/编译路径
这四个文件分别是:
tasks.json
1234567891011121314151617181920212223242526272829303132{ "version": "2.0.0", "tasks": [ { ...
03 - Editor (Vim)
Philosophy of Vim
Vim’s programming language: keystrokes are cmds, and these cmds are composable. Vim avoids the use of mouse, because it’s too slow; Vim even avoids using the arrow keys because it requires too much movement.
Modal editing
Normal: for moving around a file and making edits Initial Status
Insert: for inserting text <ESC>+I
Replace: for replacing text <ESC>+R
Visual (plain, line, or block): for selecting blocks of text <ESC>+V
Command-line: for running a comm ...
02 - Shell Tools and Scripting
Command: ls args
Read man ls and write an ls command that lists files in the following manner
Includes all files, including hidden files
Sizes are listed in human readable format (e.g. 454M instead of 454279954)
Files are ordered by recency (时效性)
Output is colorized
123456$ ls -ahltc-rw-r--r-- 1 user group 1.1M Jan 14 09:53 bazdrwxr-xr-x 5 user group 160 Jan 14 09:53 .-rw-r--r-- 1 user group 514 Jan 14 06:42 bar-rw-r--r-- 1 user group 106M Jan 13 12:12 foodrwx------+ 47 user group 1 ...
02 - Virtual Machine Monitor
Virtual Machine MonitorOverview
All computer problems can be solved with another layer of redirection.
VMM Definition
VMM transform the single machine interface into the illusion of many. Each interfaces is a replica of original computer system, complete with all of the processor instructions.
VMM 能操纵 processors
VMM implemented by adding software to an execution for all Platform HW
Platform HW: Mem, Processors, I/O devices
Why use VMM许多商用 PC 都为大型机,闲置的时候有很多空闲算力,可以以 VMM 的形式抽象多个虚拟 PC ...
01 - Shell
Shell
Collect some commands in bash I didn’t know before.
Navigating in shell
ls -l dir
drwxr-xr-x ...:
d: tell that missing is a dir
rwx: 依次表示三方对 missing 文件的权利 - the owner of the file、the owning group(users)、others
x 表示 execute
Gets more info about a program’s args, inputs, outputs and how it works: use man
1man ls
Connecting programs
Simplest: redirection is < file and > file
use >> to append to a file, this kind shines in the use of pipes. The | operator lets you ‘ch ...
01 - AOS Overview
Reading Critiques
Addressing followings:
Summary of major innovations
What the problems the paper mentioned
How about the important related work/papers
What are some intriguing aspects of the paper
How to test/compare/analyze the results
How can the research improved
If you write this paper, then how would you do?
Results from this paper
Give the survey paper list in the same research area
One Project
JOS
ReadingList of OS
find a interesting research topic/project
Analysis ...