随笔分类 -  folly

摘要:【使用】 TurnSequencer<std::atomic> seq(1); seq.waitForTurn(1);#如果没等到,就hang住 seq.completeTurn(1); #唤醒等待turn=2的线程 【接口】 【等待】 内部函数 【唤醒】 内部函数 阅读全文
posted @ 2023-01-17 23:55 stupidstan2019 阅读(73) 评论(0) 推荐(0)
摘要:【五种阻塞队列】 【先看LifoSem】 last in first out 信号量通知的queue 【调用栈】 ./fbcode_builder_getdeps-ZrootZfollyZbuildZfbcode_builder-root/build/folly/thread_pool_execut 阅读全文
posted @ 2023-01-04 21:54 stupidstan2019 阅读(184) 评论(4) 推荐(0)
摘要:【参考】 https://zhuanlan.zhihu.com/p/55917869 【cache memory】 cpu和主存间存在三级缓存 L1, L2(单核独享) L3(多核共享) 【L1和L2如何保持一致】 mesi协议定义cacheline四个状态 modified,只缓存在该cpu的缓存 阅读全文
posted @ 2023-01-04 19:45 stupidstan2019 阅读(55) 评论(0) 推荐(0)
摘要:【修改代码】 代码:ProducerConsumerQueueTest.cpp 编译二进制:producer_consumer_queue_test 文件路径:/tmp/fbcode_builder_getdeps-ZrootZfollyZbuildZfbcode_builder-root/buil 阅读全文
posted @ 2023-01-02 23:37 stupidstan2019 阅读(62) 评论(3) 推荐(0)
摘要:【命令】1)下载依赖./build/fbcode_builder/getdeps.py install-system-deps --recursive2)编译python3 ./build/fbcode_builder/getdeps.py --allow-system-packages build 阅读全文
posted @ 2023-01-02 21:57 stupidstan2019 阅读(300) 评论(1) 推荐(0)
摘要:1)总共36w 2)代码分布 阅读全文
posted @ 2022-11-27 23:57 stupidstan2019 阅读(44) 评论(0) 推荐(0)