wanghenshui / wanghenshui.github.io

my blog, please do not fork
https://wanghenshui.github.io
Other
4 stars 1 forks source link

bugbug #132

Open wanghenshui opened 3 weeks ago

wanghenshui commented 3 weeks ago

pb不能使用关键字,生成的接口带下划线。避免使用

google test抓取 异常堆栈 https://stackoverflow.com/questions/30239987/dont-know-where-exception-was-thrown-using-google-test

gdb /path/to/test catch throw r --gtest_filter='Test.Testcase' --gmock_verbose=info bt

wanghenshui commented 3 weeks ago

g++ undefined reference to typeinfo

虚函数没实现

wanghenshui commented 3 weeks ago

https://asktug.com/t/topic/93799

wanghenshui commented 1 week ago

https://stackoverflow.com/questions/47006451/how-does-facebook-follyaccessspreader-work

wanghenshui commented 1 week ago

https://stackoverflow.com/questions/68381368/c20-co-await-sleep

wanghenshui commented 1 week ago

https://stackoverflow.com/questions/47006451/how-does-facebook-follyaccessspreader-work

folly::IndexedMemPool 提供了一种高效的内存池管理策略,专为需要快速分配和回收小型元素的场景设计。以下是对其关键特性和设计决策的总结:

主要特性

索引而非指针:folly::IndexedMemPool 使用 4 字节整数索引来管理元素,而不是直接使用指针。这降低了对内存地址的直接依赖,允许使用更少的位来管理大量元素,这对于构建类似于标记指针(tagged pointer)的结构特别有用。

访问回收后的元素:即使元素已经被回收到池中,其底层内存依然可读。这个特性对于无锁算法特别有价值,因为它保证了即使在元素被回收后依然可以安全地读取元素数据,从而避免了页错误,并且如果元素内有序列号,还能确保不会发生由于类型覆盖导致的 ABA 问题。

对象生命周期策略:此特性通过Traits参数控制,folly::IndexedMemPool提供了两种预设的生命周期管理策略:

急切回收(Eager Recycle):在元素从池中分配时构造,在回收时销毁。 延迟回收(Lazy Recycle):元素在首次从池中移除时构造,并在池销毁时删除。 客户端可以通过自定义Traits实现来定制对象的生命周期管理。

性能优化:为了避免争用,folly::IndexedMemPool 维护了多个本地列表,每个线程从其关联的本地列表中检索和返回条目。这通过批量将条目放入全局自由列表来管理过大的本地列表。此设计允许高效地将项目从消费者循环回生产者。

内存管理:folly::IndexedMemPool 在构造时会为所需的地址空间进行内存映射,但会延迟元素构造,这意味着只有实际返回给调用者的元素才会被分页到进程的常驻集(RSS)中。

应用的关键建议

由于占用额外元素空间以考虑那些因位于其他本地列表中而不可访问的元素,实际可分配的元素数量介于容量和容量 + (NumLocalLists-1)*LocalListLimit 之间。这在尝试最大化池容量的同时限制结果指针的位大小时很重要。 使用 AccessSpreader 访问本地列表可以提高效率,但如果本地列表的数量超过 L1 缓存的数量,则不会带来性能优势。 folly::IndexedMemPool的这些设计选择使其成为处理小对象分配和回收、提高缓存利用效率、支持无锁数据结构等高性能并发程序的理想选择。

wanghenshui commented 1 week ago

https://github.com/facebook/folly/blob/main/folly/IndexedMemPool.h

wanghenshui commented 1 week ago

braft

https://wine93.gitbook.io/learn-raft/ch06/change_leader

curve https://my.oschina.net/u/4565392/blog/5519430 https://zhuanlan.zhihu.com/p/333884273 https://zhuanlan.zhihu.com/p/505366980 https://zhuanlan.zhihu.com/p/336674195 https://yriuns.github.io/2022/01/08/braft-in-action/

https://zhuanlan.zhihu.com/p/169840204

https://zhuanlan.zhihu.com/p/169904153

把braft 知乎文章看一遍

https://github.sheincorp.cn/baidu/braft/issues/ 332 有bug?

https://steinslab.io/archives/2605 metric https://luobuda.github.io/2023/01/07/Work-Review/ https://luobuda.github.io/2022/02/15/braft-snapshot%E5%AE%9E%E7%8E%B0/ https://blog.csdn.net/qq_35102066/article/details/122832550 问题,如果关闭周期性snapshot,什么时候truncate日志呢?无限膨胀?

https://zhuanlan.zhihu.com/p/690232462 https://zhuanlan.zhihu.com/p/639480562 https://github.com//kasshu/braft-docs/blob/master/cn/Braft%20detailed%20explanation.md

wanghenshui commented 1 week ago

http://aspirer.wang/?p=1842 文章不错,读一遍

wanghenshui commented 1 week ago

redis 测试 https://www.dragonflydb.io/docs/getting-started/benchmark

https://www.cnblogs.com/wangcp-2014/p/14268042.html

wanghenshui commented 1 week ago

https://illx10000.github.io/2018/12/29/6.html brpc iobuf

wanghenshui commented 1 week ago

lldb coredump

lldb --core /cores/core.78906 memtier_benchmark