什么是线程安全函数?
来源:互联网 发布:知彼手机定位怎么样 编辑:程序博客网 时间:2024/04/30 18:44
前面,我们讲了可重入函数,现在看看线程安全函数。首先,我们来欣赏一幅图吧:
看看维基百科:
Thread safety is a computer programming concept applicable in the context of multi-threaded programs. A piece of code is thread-safe if it only manipulates shared data structures in a manner that guarantees safe execution by multiple threads at the same time.
多的不说了,最后以strtok函数结尾本文(参照上图):
1. strtok不可重入,线程不安全
2. 加锁的strtok不可重入,但线程安全
3. strtok_r可重入,线程安全
累了,喝口水,洗澡去。
0 0
- 什么是线程安全函数?
- Java:什么是线程安全
- 什么是线程安全?
- 什么是线程安全
- 什么是线程安全?
- 什么是线程安全
- 什么是线程安全
- 什么是线程安全?
- 什么是线程安全?
- 什么是线程安全?
- 什么是线程安全
- 什么是线程安全
- 什么是线程安全
- 什么是线程安全
- 什么是线程安全
- 什么是线程安全
- 什么是线程安全
- 什么是线程安全
- python中的generator高级用法 -- send
- Struts2常用标签总结--转载
- SSE2介绍及其简单用法举例
- Linux环境变量设置
- 如何在windows下的Python开发工具IDLE里安装其他模块?
- 什么是线程安全函数?
- 关于动态规划法的问题
- Permutations-LeetCode
- u-boot移植与分析记录之二【S5PV210芯片手册时钟控制器部分的翻译】
- python操作excel
- 界面布局
- OI刷题记录
- 数据结构之线性表题目总结
- mysql问题