会员
周边
新闻
博问
闪存
赞助商
YouClaw
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
wu_overflow
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
9
···
30
下一页
2015年10月17日
并发快速排序的面向对象解决方案
摘要: templatestruct Sorter{ struct ChunkToSort { std::list data; std::promise> promise; }; ThreadSafeStack chun...
阅读全文
posted @ 2015-10-17 11:11 wu_overflow
阅读(241)
评论(0)
推荐(0)
2015年10月16日
有锁的线程安全栈
摘要: templateclass ThreadSafeStack{private: std::stack data; mutable std::mutex m;public: ThreadSafeStack() = default; ThreadSafeStack(con...
阅读全文
posted @ 2015-10-16 14:24 wu_overflow
阅读(345)
评论(0)
推荐(0)
2015年10月5日
无锁栈的实现
摘要: templateclass LockFreeStack{private: struct Node; struct CountedNode { int externalCount = 0; Node* ptr = nullp...
阅读全文
posted @ 2015-10-05 02:39 wu_overflow
阅读(226)
评论(0)
推荐(0)
2015年10月3日
使用风险指针(hazard pointer) 处理无锁栈的 push 与 pop
摘要: constexpr size_t maxHazardPointers = 100;struct HazardPointer{ std::atomic id; std::atomic pointer;};array hazardPointers;class Hazard...
阅读全文
posted @ 2015-10-03 16:18 wu_overflow
阅读(721)
评论(1)
推荐(0)
2015年9月30日
使用引用计数方法管理内存的无锁栈 I
摘要: templateclass LockFreeStack{private: struct Node { std::shared_ptr data; Node* next; Node(T const& value): ...
阅读全文
posted @ 2015-09-30 10:20 wu_overflow
阅读(343)
评论(0)
推荐(0)
2015年9月29日
线程安全的链表
摘要: templateclass ThreadsafeList{ struct Node { std::mutex m; std::shared_ptr data; std::unique_ptr next; Node(): ...
阅读全文
posted @ 2015-09-29 09:33 wu_overflow
阅读(1155)
评论(0)
推荐(0)
2015年9月27日
线程安全的查找表
摘要: template>class ThreadsafeLookupTable{private: class BucketType { private: typedef std::pair bucketValue; typedef std::list buck...
阅读全文
posted @ 2015-09-27 10:06 wu_overflow
阅读(163)
评论(0)
推荐(0)
2015年9月26日
Qt 使用 boost
摘要: 倒是很简单啊,我是先用 brew istall 安装的 boost,Qt creator 的版本是 3.4.2然后右键项目,选择添加库,接着在相应的文件夹里选择相应的后缀为 .a 的库文件,.pro 中就会自动配置。所以这就完了吗?当然不,我这里报错:can't map file crrno=22 ...
阅读全文
posted @ 2015-09-26 17:57 wu_overflow
阅读(379)
评论(0)
推荐(0)
细粒度锁的极简单线程安全队列
摘要: templateclass ThreadsafeQueue{private: struct Node { std::shared_ptr data; std::unique_ptr next; }; std::unique_...
阅读全文
posted @ 2015-09-26 09:18 wu_overflow
阅读(659)
评论(0)
推荐(0)
2015年9月24日
更为适合并发的极简易队列
摘要: 上一篇文章里说到了一个极简易队列的实现,然而它对于并发存在一个问题,就是当多个或者说就是两个线程并发地访问队列,分别调用 push() 与 tryPop() 时,可能就会导致数据争用或者死锁。以下是一种思路,通过分离数据允许并发。其大致思路是预先分配一个不储存任何数据的结点占位,当 push() 进...
阅读全文
posted @ 2015-09-24 18:48 wu_overflow
阅读(313)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
···
30
下一页
公告