Notes on the google spanner paper
The traits of Google Spanner
- horizontal scalability, keys partitioned into shards(named “Directory” in the paper)
- Transaction and extern consistency
- RW transactions require 2 phase commit and 2 phase locking with locks stored on a lock table on each Span Master
- R only transactions requires no lock and no 2 phase commit. Read is fast since the client query it’s the nearest replica and reads the latest data, likely without blocking (Even no Paxos sync latency).
MIT 6.824 Lab 4: Sharded KeyValue Service的个人实现
终于把lab4写到过test稳如狗了. 回顾这段时间, 看日志看得头疼. 写这个lab可比打只狼硬核多了. 能写完完全靠坚持. 当跑通test的时候, 我感觉我要high到天上去了.
MIT 6.824 lab 3 一种client request 去重方式
终于吧lab3调通到1k次运行稳如狗了. 写这个lab我感觉还是得靠坚持. 看到极低概率的失败还是心里会咯噔一下的. 不像是lab2, 照着论文算法按部就班老老实实写出来, Lab3给我感觉提供了更大的发挥空间, 很多种实现方式, 得自己来设计一些关键的步骤.
Parallel Cholesky decomposition implemation
Data partition
memo: a bug which double close the socket acceptor fd
A exception raises with the rate around 10% in all execution in Mac OS:
Class Interface design and thread-safe in concurrent programming
I wrote a logging manager for logging. The logging manager maintains a thread-safe queue and creates a new thread for asynchronous logging, let’s call it logging thread. The queue is used to deliver logging records to the logging thread which is doing an infinite loop of retrieving records from that queue until a stop token received.
The interface of the logging manager is below:
class GlobalLoggerManager {
private:
threadsafe_queue queue;
std::thread logging_deamon;
public:
GlobalLoggerManager(int level);
GlobalLoggerManager(int level, const char *file_path);
void new_records(const record &r);
void loop_body();
void stop();
};
don’t forget naming the variable when using RAII
RAII is an awesome design and very useful to accomplish tasks like “I want something automatically done and cleaned up nicely at the end of current scope”.
虚拟机主从复制-MIT 6.824 lec4
虚拟机主从复制-MIT 6.824 lec4
Ukkoen算法构建后缀树实现
花了两天看懂并且实现了后缀树线性时间内构建…
SFINAE must be in the immediate context
SFINAE is the provides the essential “Patten matching” like feature to C++ template meta-programming.