SFINAE简单实例
摘要:SFINAE(Substitution failure is not an error),是C++11以来推出的一个重要概念,这里,只是简单举一个例子,可能会有人需要。
阅读全文
posted @
2018-03-20 09:26
月落无影
阅读(299)
推荐(0)
Sequentially-consistent ordering
摘要:先引入cppreference中的描述: Atomic operations tagged memory_order_seq_cst not only order memory the same way as release/acquire ordering (everything that hap
阅读全文
posted @
2018-03-18 17:42
月落无影
阅读(669)
推荐(0)
hierarchical_mutex函数问题(C++ Concurrent in Action)
摘要:C++ Concurrent in Action(英文版)书上(No.52-No.53)写的hierarchical_mutex函数,只适合结合std::lock_guard使用,直接使用如果不考虑顺序,可能会出现问题。 参看hierarchical_mutex类的代码: 测试代码: 正确时,输出值
阅读全文
posted @
2018-03-18 16:09
月落无影
阅读(849)
推荐(0)
不同AI学科之间的联系
摘要:这里只是引用deep learning中的关于不同AI学科之间联系的图示,如果想具体了解相关知识,深入学习深度学习,可以参考网站:http://www.deeplearningbook.org 下面是引用的描述: To summarize, deep learning, the subject of
阅读全文
posted @
2018-03-13 10:25
月落无影
阅读(429)
推荐(0)
通过atomic_flag简单自旋锁实现简单说明标准库中锁使用的memory_order
摘要:在使用标准库中的加锁机制时,例如我们使用std::mutex,写了如下的代码(下面的代码使用condition_variable可能更合适) 我们知道如果先运行线程1的代码,也就是说线程1获得了锁,进行了准备资源的操作。然后运行线程2,也就是说线程2之后获得了锁,可以知道线程1加锁区域的代码已经执行
阅读全文
posted @
2018-03-12 16:39
月落无影
阅读(783)
推荐(0)
基于folly的AtomicIntrusiveLinkedList无锁队列进行简单封装的多生产多消费模型
摘要:1.基于folly的AtomicIntrusiveLinkedList略微修改的无锁队列代码: 2.基于上面无锁队列的封装 3.测试用代码: 4. 基于AtomicIntrusiveLinkedList插入操作可以一次插入一个节点,而移出操作则会一次移出多个节点,如果每个消费队列都使用一个Atomi
阅读全文
posted @
2018-03-09 20:14
月落无影
阅读(839)
推荐(0)
sleep function error ("Advanced Programming in the UNIX Environment" Third Edition No.374)
摘要:测试证明代码: 操作说明,这里我给出我和作者交流时的说明,所以用的是英文,不过我英文水平有限,希望谅解: I should give you my manipulation. You should send a SIGUSR1 to the process in less than 20 secon
阅读全文
posted @
2018-03-06 08:14
月落无影
阅读(286)
推荐(0)