简介: DisableThreadLibraryCalls
2012-11-14 10:24
971 查看
BOOL WINAPI DisableThreadLibraryCalls(
__in HMODULE hModule
);
Disables the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications for the specified dynamic-link library (DLL). This can reduce the size of the working set for some applications.
禁用指定的DLL的DLL_THREAD_ATTACH和DLL_THREAD_DETACH通知,这样可以减小某些程序的工作集大小。
Remarks:
The DisableThreadLibraryCalls function lets a DLL disable the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notification calls. This can be a useful optimization for multithreaded applications that have many DLLs, frequently create and delete
threads, and whose DLLs do not need these thread-level notifications of attachment/detachment. A remote procedure call (RPC) server application is an example of such an application. In these sorts of applications, DLL initialization routines often remain in
memory to service DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications. By disabling the notifications, the DLL initialization code is not paged in because a thread is created or deleted, thus reducing the size of the application's working code set. To implement
the optimization, modify a DLL's DLL_PROCESS_ATTACH code to call DisableThreadLibraryCalls.
该函数禁用一个DLL的DLL_THREAD_ATTACH和DLL_THREAD_DETACH通知。这对于那些经常创建和删除线程的调用很多DLL的多线程程序是一个很有用的选项。如果这些DLL并不需要这些线程级的attachment/detachment通知。远程过程调用服务程序就是一个例子。在这些程序里,DLL的初始化代码经常留在物理内存里,以相应DLL_THREAD_ATTACH和DLL_THREAD_DETACH通知。通过禁用这些通知,DLL的初始化代码不会由于线程的创建和删除被换页至物理内存,这样就可以减小工作代码集的大小。要实现这个选项,可以在响应DLL_PROCESS_ATTACH通知的时候调用DisableThreadLibraryCalls
__in HMODULE hModule
);
Disables the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications for the specified dynamic-link library (DLL). This can reduce the size of the working set for some applications.
禁用指定的DLL的DLL_THREAD_ATTACH和DLL_THREAD_DETACH通知,这样可以减小某些程序的工作集大小。
Remarks:
The DisableThreadLibraryCalls function lets a DLL disable the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notification calls. This can be a useful optimization for multithreaded applications that have many DLLs, frequently create and delete
threads, and whose DLLs do not need these thread-level notifications of attachment/detachment. A remote procedure call (RPC) server application is an example of such an application. In these sorts of applications, DLL initialization routines often remain in
memory to service DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications. By disabling the notifications, the DLL initialization code is not paged in because a thread is created or deleted, thus reducing the size of the application's working code set. To implement
the optimization, modify a DLL's DLL_PROCESS_ATTACH code to call DisableThreadLibraryCalls.
该函数禁用一个DLL的DLL_THREAD_ATTACH和DLL_THREAD_DETACH通知。这对于那些经常创建和删除线程的调用很多DLL的多线程程序是一个很有用的选项。如果这些DLL并不需要这些线程级的attachment/detachment通知。远程过程调用服务程序就是一个例子。在这些程序里,DLL的初始化代码经常留在物理内存里,以相应DLL_THREAD_ATTACH和DLL_THREAD_DETACH通知。通过禁用这些通知,DLL的初始化代码不会由于线程的创建和删除被换页至物理内存,这样就可以减小工作代码集的大小。要实现这个选项,可以在响应DLL_PROCESS_ATTACH通知的时候调用DisableThreadLibraryCalls
相关文章推荐
- [转载]DllMain中不当操作导致死锁问题的分析--DisableThreadLibraryCalls对DllMain中死锁的影响
- DisableThreadLibraryCalls 的作用
- DllMain中不当操作导致死锁问题的分析--DisableThreadLibraryCalls对DllMain中死锁的影响
- DllMain中不当操作导致死锁问题的分析--DisableThreadLibraryCalls对DllMain中死锁的影响
- DisableThreadLibraryCalls
- DisableThreadLibraryCalls
- 0.VC(Custom)-DisableThreadLibraryCalls
- POSIX thread library 简介I
- cmph (C Minimal Perfect Hashing Library)个人理解及应用简介
- CheckForIllegalCrossThreadCalls=false;的不安全性
- How to: Make Thread-Safe Calls to Windows Forms Controls
- 利用CheckForIllegalCrossThreadCalls=false设置跨线程访问
- Delphi container library X 库简介
- android 开发 GitHub Android Librarys Top 100 简介
- Android ActivityThread(主线程或UI线程)简介
- Thread Safety in the Standard C++ Library
- Control.CheckForIllegalCrossThreadCalls
- How to: Make Thread-Safe Calls to Windows Forms Controls
- Android ActivityThread(主线程或UI线程)简介
- CQRS体系结构模式实践案例:Tiny Library:简介