会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
fchy822
博客园
首页
新随笔
联系
订阅
管理
1
2
3
4
下一页
2024年11月8日
golang Happens-Before 原则
摘要: 概念&定义: 在 Go 中,如果一个操作 A happens-before 操作 B,则意味着: A 的结果对于 B 是可见的。 B 的执行可以依赖于 A 的执行结果。 Happens-Before 规则: 1)Goroutine启动: go语句happens-before函数的第一个语句。 2)管
阅读全文
posted @ 2024-11-08 10:16 fchy822
阅读(56)
评论(0)
推荐(0)
2024年4月19日
redis内存淘汰策略
摘要: LRU: https://javap.blog.csdn.net/article/details/133889335 LFU: https://blog.csdn.net/qq_32099833/article/details/133889357
阅读全文
posted @ 2024-04-19 16:12 fchy822
阅读(10)
评论(0)
推荐(0)
2024年4月11日
C++20/21新特性
摘要: 一、概念(Concepts):为模板编程提供了更清晰的约束和检查机制。 template <typename T> concept Integral = std::is_integral_v<T>; // Integral约定类型T必须是整形 // std::is_integral_v<T> 等价于
阅读全文
posted @ 2024-04-11 17:40 fchy822
阅读(250)
评论(0)
推荐(0)
C++ 类型特征(Type Traits)
摘要: 分类类型特征描述C++标准_v写法(C++17) 基本类型特性检查 std::is_same<T1, T2>::value 检查两个类型是否相同 C++11 std::is_same_v<T1, T2> std::is_integral<T>::value 检查T是否为整数类型 C++11 std:
阅读全文
posted @ 2024-04-11 14:52 fchy822
阅读(77)
评论(0)
推荐(0)
2024年4月9日
左值&右值&移动语义&完美转发
摘要: https://blog.csdn.net/zzy979481894/article/details/130981693
阅读全文
posted @ 2024-04-09 14:20 fchy822
阅读(23)
评论(0)
推荐(0)
2024年4月2日
单链表
摘要: template<typename T> class threadsafe_list { struct node // 1 { std::mutex m; std::shared_ptr<T> data; std::unique_ptr<node> next; node(): // 2 next()
阅读全文
posted @ 2024-04-02 17:53 fchy822
阅读(15)
评论(0)
推荐(0)
队列
摘要: #include <iostream> #include <mutex> #include <condition_variable> #include <thread> template<typename T> class ThreadSafeQueue { private: struct Node
阅读全文
posted @ 2024-04-02 16:18 fchy822
阅读(34)
评论(0)
推荐(0)
栈
摘要: class ThreadSafeLinkedStack { private: struct Node { T data; std::shared_ptr<Node> next; Node(T data) : data(data), next(nullptr) {} }; std::shared_pt
阅读全文
posted @ 2024-04-02 10:49 fchy822
阅读(14)
评论(0)
推荐(0)
2024年4月1日
C++ 原子操作
摘要: 内存屏障,也称为内存栅栏、内存栅障或屏障指令,是一类同步屏障指令。它是CPU或编译器在对内存随机访问的操作中的一个同步点,确保此点之前的所有读写操作都执行完毕后,才可以开始执行此点之后的操作。 1)原子性(Atomicity): 原子性是指一个或多个操作作为一个整体来执行,中途不会被其他线程打断。在
阅读全文
posted @ 2024-04-01 14:35 fchy822
阅读(74)
评论(0)
推荐(0)
2022年9月29日
回溯算法思想
摘要: 一、回溯模板时刻铭记于心 // backtrace: // if 满足条件: // 添加到结果集 // return // for elem in 可选: // 选择 // backtrace() // 退回选择 二、回溯思想 ### 回朔法的思想: 回朔法的重要思想在于: 通过枚举法,对所有可能性
阅读全文
posted @ 2022-09-29 15:19 fchy822
阅读(57)
评论(0)
推荐(0)
1
2
3
4
下一页
公告