2019独角兽企业重金招聘Python工程师标准>>>

Thread Safety in the Standard C++ Library

When  /MT , /MTd, /MD, or /MDd is used, the following thread-safety rules are in effect:

Container Classes (vector, deque, list, queue, stack , priority_queue, valarray, map, multimap, set, multiset, basic_string, bitset) and complex

For reads to the same object, the object is thread safe for reading:

  • From one thread at a time when no writers on other threads.
  • From many threads at a time when no writers on other threads.

For writes to the same object, the object is thread safe for writing from one thread when no readers on other threads

For reads to different objects of the same class, the object is thread safe for reading:

  • From one thread at a time.
  • From one thread at a time when no writers on other threads.
  • From many threads at a time.
  • From many threads at a time when no writers on other threads.

For writes to different objects of the same class, the object is thread safe for writing:

  • From one thread when no readers on other threads.
  • From many threads.

iostream Classes

Note that reading from a stream buffer is not considered to be a read operation. It should be considered as a write operation, because this changes the state of the class.

For reads to the same object, the object is thread safe for reading:

  • From one thread at a time when no writers on other threads.
  • From many threads at a time when no writers on other threads.

For writes to the same object, , the object is thread safe for writing:

  • From one thread when no readers on other threads.
  • From many threads (when accesses are limited to stream buffers).

For reads to different objects of the same class, , the object is thread safe for reading:

  • From one thread at a time.
  • From one thread at a time when no writers on other threads.
  • From many threads at a time.
  • From many threads at a time when no writers on other threads.

For writes to different objects of the same class, the object is thread safe for writing:

  • From one thread when no readers on other threads
  • From many threads

转载于:https://my.oschina.net/u/230229/blog/110067

Thread Safety in the Standard C++ Library相关推荐

  1. 折返(Reentrancy)VS线程安全(Thread safety)

    在Wiki上,折返例如,下面的定义(接) In computing, a computer program or subroutine is called reentrant if it can be ...

  2. Standard C Library - 思维火花 - 博客频道 - CSDN.NET

    Standard C Library - 思维火花 - 博客频道 - CSDN.NET « DIY 了一套 ACQUIRE | 返回首页 | 骨骼动画的插值与融合 » 动态数组的 C 实现 上次谈到了 ...

  3. (转)The Standard C Library 经典的基础(上)

    The Standard C Library 经典的基础 C的标志库函数是学习和使用C语言的基础,是编写经典C程序的基础,是学习其他计算机知识的基础.C标志库中一共包含了15个头文件: <ass ...

  4. 标准模板库STL(Standard Template Library)

    标准模板库STL(Standard Template Library)指南 /*刘振飞liuzf@pku.org.cn 1999-10-20*/ / *版权所有 (C) 1999-2004 刘振飞li ...

  5. STM32 Tips:如何从ST官方网站上下载STM32标准外设库(STM32F10x standard peripheral library)

    入手了一块STM32F107VCT6开发板,配置开发环境时需要一个库:STM32F10x标准外设库(STM32F10x standard peripheral library),在网上看到很多初学者和 ...

  6. STM32 标准外设库(Standard Peripheral Library)下载

    STM32 标准外设库(Standard Peripheral Library)下载. 一.链接 STM32 Standard Peripheral Libraries - STMicroelectr ...

  7. STL序列式容器Standard Template Library Sequence Container

    STL序列式容器 STL Sequence Container 目录 STL序列式容器 STL Sequence Container STL(Standard Template Library)概述 ...

  8. PI 使用JNative连接报错Exception in thread “main“ java.lang.IllegalStateException: JNative library not load

    使用java调用PiApiTools连接PI数据库报错: Exception in thread "main" java.lang.IllegalStateException: J ...

  9. java标签库 taglib pdf格式_JSP系列教材 (十)- JSTL Java Standard Tag Library 标准标签库...

    JSTL JSP Standard Tag Library 标准标签库 JSTL允许开人员可以像使用HTML标签 那样在JSP中开发Java功能. JSTL库有core, i18n, fmt, sql ...

最新文章

  1. LeetCode算法题-Reverse Linked List(Java实现)
  2. mydumper 0.6.2 安装,dba的必备备份工具,必须掌握
  3. Leetcode - 347. Top K Frequent Elements(堆排序)
  4. zookeeper集群配置与配置文件详解
  5. 解决linux下无线网卡被物理禁用问题
  6. Games101现代图形学入门Lecture 3: Transformation知识点总结
  7. .net数据绑定控件中的数据导出到Excel
  8. map insert异常失败_处理dubbo反序列化失败的坑
  9. cesium等高线_Cesium开源三维地球离线地图发布源码示例功能
  10. 怎么控制ajax执行先后顺序,[转]多个ajax请求时控制执行顺序或全部执行后的操作...
  11. 【java】关于Map的排序性的一次使用,有序的Map
  12. BZOJ 1412: [ZJOI2009]狼和羊的故事( 最小割 )
  13. c语言第三周编程作业答案,c语言程序设计第3周编程作业(数字特征)
  14. linux备份系统 硬盘数据,Linux怎么备份系统
  15. virtio iommu
  16. 用计算机开方左右键,科学计算器开方怎么用(科学计算器开根号)
  17. matlab投资组合权重,Matlab做投资组合最优化
  18. 从写博到出书:过程全记录
  19. Delphi 编译的程序在win10中怎样默认以管理员身份运行
  20. 汇编语言--LC3tools实现两个32位数相加

热门文章

  1. c语言常用的字符串处理函数
  2. 8个秘诀成就顶级增长黑客
  3. ServletContextListener接口用法
  4. 数据库多表连接查询详解
  5. ubuntu修改启动为文本模式
  6. 团队在Github上协同开发项目流程
  7. Linq 对List的一些操作
  8. .net程序员转战android第一篇---环境部署
  9. 140个绝对绝对值得收藏的电脑技巧1
  10. WinAPI: midiOutReset - 重置输出设备