Thread-specific data
来源:互联网 发布:美国枪击案与网络恶搞 编辑:程序博客网 时间:2024/05/01 12:24
Typical applications that are not threaded use global storage. When changing the application or application services to run in a multithreaded application, you must use a synchronization technique to protect global storage from being changed by multiple threads at the same time. Thread-specific data allows a thread to maintain its own global storage that is hidden from the other threads.
Due to the design of the application, threads may not function correctly if they share the global storage of the application. If eliminating the global storage is not feasible, you should consider using thread-specific data.
Consider the example of a server that stores information about the client and the current transaction in global storage. This server would never be able to share the client information in a multithreaded environment without significant redesign. The application could instead pass the client information from function to function instead of using the global client information.
However, the application could maintain the client and transaction information in thread-specific data more easily than it could be modified to eliminate the use of global storage. When each new thread is created, the thread would use a global identifier (or key) to create and store its thread-specific data. Each client (thread) would then have unique but global client data.
In addition, some application programming interface (API) sets provide a way for the system to automatically call a data destructor function that cleans up the thread-specific data when a thread ends.
Use the following as examples for your program:
- Example: Thread-specific data in Pthread programs
- Example: Thread-specific data in Java programs
- Thread-specific data
- Thread-specific data
- TSD(Thread Specific Data)线程专有数据
- 线程私有数据(Thread-Specific Data)
- 线程专有变量 thread specific data
- linux 多线程编程 Thread Specific Data (TSD)
- 线程专有数据(Thread-Specific Data)
- Thread-Specific Data(线程私有数据)
- Thread-Specific Data(TSD)线程私有数据
- 线程私有数据(Thread-specific Data,或TSD)
- 开源日志系统 - NDC(Thread-specific Data)
- 线程的属性和 线程特定数据 Thread-specific Data
- 线程的私有数据(TSD-Thread-Specific Data)
- 线程局部存储 Thread Local Storage 线程特定数据 Thread-Specific Data
- Thread-Specific Storage
- Thread-Specific Storage
- Thread-Specific Storage 模式
- Thread Specific Storage
- 脚本动态生成VML
- 基于 Android NDK 的学习之旅-----数据传输一(基本数据类型和数组传输)(附源码)
- [转]Windows文件系统的杂谈
- 网上摘的。关于android屏幕翻转的。留着有好处。。。。
- Hibernate查询
- Thread-specific data
- String与Date类型互转
- Asp.net 算时间差 -- XXX小时前,XXX天以前,XXX分钟以前 发布
- P2P技术
- VC创建启动即隐藏的对话框(转)
- 只有电话线如何上网
- 有关“.mht”格式
- OPhone网络应用编程实例: 豆瓣电台客户端
- 文件分割与合并(C# Winforms)