读书人

问一下子动态tls有什么用

发布时间: 2013-11-09 17:06:41 作者: rapoo

问一下动态tls有什么用?
动态tls有四个API,运行了网上给的列子。不知道tls有什么用?
[解决办法]
参考 TLS--线程局部存储
[解决办法]
是存放 线程 私有 变量的 地方
[解决办法]
可以放一些线程自己相关的数据等。
[解决办法]
Thread Local Storage (TLS) is the mechanism by which each thread in a given multithreaded process allocates storage for thread-specific data. In standard multithreaded programs, data is shared among all threads of a given process, whereas thread local storage is the mechanism for allocating per-thread data.
[解决办法]
动态tls是dll用的.
exe用静态就行.
[解决办法]
设计一些库,并把线程相关的一些库需要的数据保存在tls中,使得对库的多线程调用互不影响

读书人网 >VC/MFC

热点推荐