跳过导航链接
Oracle Solaris Studio 12.3:线程分析器用户指南
Oracle Solaris Studio 12.3 Information Library (简体中文)
搜索范围:
本文档
整个文档库
Oracle Solaris Studio 12.3:线程分析器用户指南
2011 年 12 月,E26459-01
本线程分析器用户指南介绍线程分析器工具并提供了两套详尽的教程。其中一套重点介绍数据争用检测,另一套介绍死锁检测。本手册还有两个附录,分别介绍有用的提示和受支持的 API。
文档信息
前言
1. 什么是线程分析器?它有什么作用?
1.1 线程分析器入门
1.1.1 什么是数据争用?
1.1.2 什么是死锁?
1.2 线程分析器使用模型
1.2.1 检测数据争用的使用模型
1.2.1.1 检测代码以检测数据争用
源代码级别检测
二进制代码级别检测
1.2.1.2 基于检测后的应用程序创建实验
1.2.1.3 检查实验中是否存在数据争用
1.2.2 检测死锁的使用模型
1.2.2.1 创建用于检测死锁的实验
1.2.2.2 检查实验中是否存在死锁
1.2.3 检测数据争用和死锁的使用模型
1.3 线程分析器界面
2. 数据争用教程
2.1 数据争用教程源文件
2.1.1 获取数据争用教程源文件
2.1.2
prime_omp.c
的源代码
2.1.3
prime_pthr.c
的源代码
2.1.3.1 数据争用在
prime_omp.c
和
prime_pthr.c
中的效果
2.2 如何使用线程分析器查找数据争用
2.2.1 检测代码
2.2.1.1 检测源代码
2.2.1.2 检测二进制代码
2.2.2 创建数据争用检测实验
2.2.3 检查数据争用检测实验
2.2.3.1 使用线程分析器查看数据争用实验
2.2.3.2 使用
er_print
查看数据争用实验
2.3 了解实验结果
2.3.1
prime_omp.c
中的数据争用
2.3.2
prime_pthr.c
中的数据争用
2.3.3 数据争用的调用堆栈跟踪
2.4 诊断数据争用的原因
2.4.1 检查数据争用是否为误报
2.4.2 检查数据争用是否为良性
2.4.3 修复错误而不是修复数据争用
2.4.3.1 修复
prime_omp.c
中的错误
2.4.3.2 修复
prime_pthr.c
中的错误
2.5 误报
2.5.1 用户定义的同步
2.5.2 由不同线程回收的内存
2.6 良性数据争用
2.6.1 用于查找质数的程序
2.6.2 用于检验数组值类型的程序
2.6.3 使用双检锁的程序
3. 死锁教程
3.1 关于死锁
3.2 获取死锁教程源文件
3.2.1
din_philo.c
的源代码内容
3.3 哲学家就餐方案
3.3.1 哲学家如何发生死锁
3.3.2 为 1 号哲学家引入一段休眠时间
3.4 如何使用线程分析器查找死锁
3.4.1 编译源代码
3.4.2 创建死锁检测实验
3.4.3 检查死锁检测实验
3.4.3.1 使用线程分析器查看死锁检测实验
3.4.3.2 使用
er_print
查看死锁检测实验
3.5 了解死锁实验结果
3.5.1 检查出现死锁的运行
3.5.2 检查存在潜在死锁但仍可完成的运行
3.6 修复死锁和了解误报
3.6.1 使用令牌控制哲学家
3.6.1.1 误报的报告
3.6.2 另一种令牌机制
A. 线程分析器可识别的 API
A.1 线程分析器用户 API
A.2 其他可识别的 API
A.2.1 POSIX 线程 API
A.2.2 Solaris 线程 API
A.2.3 内存分配 API
A.2.4 内存操作 API
A.2.5 字符串操作 API
A.2.6 OpenMP API
B. 有用提示
B.1 编译应用程序
B.2 检测应用程序以检测数据争用
B.3 使用 collect 命令运行应用程序
B.4 报告数据争用