SmallLocks
folly/SmallLocks.h
This module is currently x64 only.
This header defines two very small mutex types. These are useful in highly memory-constrained environments where contention is unlikely. The purpose of these is to allow fine-grained locking in massive data structures where memory is at a premium. Often, each record may have a spare bit or byte lying around, so sometimes these can be tacked on with no additional memory cost.
There are two types exported from this header. MicroSpinLock is a single byte lock, and PicoSpinLock can be wrapped around an integer to use a single bit as a lock. Why do we have both? Because you can't use x64 bts on a single byte, sosizeof(MicroSpinLock) is smaller than sizeof(PicoSpinLock) can be, giving it some use cases.
Both the locks in this header model the C++11 Lockable concept. So you can use std::lock_guard or std::unique_lock to lock them in an RAII way if you want.
Additional information is in the header.
SmallLocks的更多相关文章
- 一个无锁消息队列引发的血案(五)——RingQueue(中) 休眠的艺术
目录 (一)起因 (二)混合自旋锁 (三)q3.h 与 RingBuffer (四)RingQueue(上) 自旋锁 (五)RingQueue(中) 休眠的艺术 (六)RingQueue(中) 休眠的 ...
- folly学习心得(转)
原文地址: https://www.cnblogs.com/Leo_wl/archive/2012/06/27/2566346.html 阅读目录 学习代码库的一般步骤 folly库的学习心得 ...
- Folly: Facebook Open-source Library Readme.md 和 Overview.md(感觉包含的东西并不多,还是Boost更有用)
folly/ For a high level overview see the README Components Below is a list of (some) Folly component ...
随机推荐
- js 判断浏览器类型及版本
1.思路: 能力检测 + 字符串检索 2.例子 IE Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0) ActiveXObject函 ...
- webpack+angular2开发环境搭建
升级版之webpack4 + angular5脚手架demo详见: http://www.cnblogs.com/xudengwei/p/8852257.html 刚搭建完一个webpack+angu ...
- 微信小程序-TabBar功能实现
要实现tabbar的导航条其实很简单,我们要实现全局的tabbar只需要在app.json文件中定义即可,局部的就在局部的tabbar文件中实现. 来看看app.json代码: { "pag ...
- Python小工具之消耗系统指定大小内存
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import re import time def print_help(): print ' ...
- VS2017打包安装程序
VS2017 并不自带安装部署项目,需要在[扩展和更新]中安装插件:Microsoft Visual Studio 2017 Installer Projects(现更名为Microsoft Visu ...
- 抽象工厂 C++实现
抽象工厂(Abstract Factory) 抽象工厂是为了提供一系列相关或相互依赖对象的接口.对象创建型模式的一种. 客户Client 抽象工厂接口AbstractFactory 抽象工厂的实现类C ...
- 『转』Emsisoft Anti-Malware 8刷Key教程 - 文字版
先分主机和客机,下载好 EAM8安装包 和 30天重置工具EAM Trial Reset 1.1.exe 1. 主机安装 Emsisoft Anti-Malware 8 并激活30天试用版 如果已 ...
- SpringInAction--SpringMvc高级技术(servlet、filter、multipart)
前面学了spirng的一些配置,以及web方面的知识,今天就在学习一下在spring比较常用的一些高级技术... 首先来介绍下什么叫servlet吧(来着维基百科) Servlet(Server Ap ...
- 通过VNC连接远程服务器,然后登陆服务器上的虚拟机,出现键盘输入问题的解决方法
前几天由于要在服务器上装一个虚拟机,然后就选择了vmware workstation,装好之后,进入虚拟机中的centOS系统,发现键盘上的Cpas Lock键不起作用,按下之后还是输入小写,而且按住 ...
- APP界面框架初窥---标签导航
标签导航是十大界面框架设计里最常用的界面框架设计,也是被业界之内公认的一种普遍使用的页面框架设计.那么这种页面框架设计在作业方面对一个用户来说也是最常见的一种页面框架设计,比如说微博.微信.手机百度. ...