Contents (click to collapse) >>

braft call graph

This is the call graph of braft, an industrial grade raft implementation, which may help you understand braft better, I guess.

I made it several months ago with dot-lang (graphviz), and build the svg with my graphviz plugin, the nodes are clickable.

I also have made call graphs of other projects such as thrift, brpc and etc.. They will be posted when I have time to eliminate the parts that are not proper for publication.

Legend:

  • each enclosed shape is called a node
    • ellipse for procedure
    • square for note/comment
  • solid arrow for “sync” call/procedure
  • dash connection or dash arrow for “async” call/procedure or something that is indirectly associated, e.g., background thread, queue of a thread pool
  • number on the connection means process sequence
  • element in red color means important

(click this image to get svg view with interaction)

从 shared_from_this() 谈智能指针 weak_ptr 和 shared_ptr 的实现

一般来说c++ `shared_ptr` 实现逻辑上基本上都是一个ptr加上一个control block来实现,control block 用于保存引用计数以及如何回收(deleter)等信息,有一些实现(gcc)会将ptr放到control block里,有的(llvm...… Continue reading

Clock And Timestamp

Published on August 16, 2019

memory ordering

Published on April 30, 2019