久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

為什么 Windows 10 會在我的程序中啟動額外的線程

Why does Windows 10 start extra threads in my program?(為什么 Windows 10 會在我的程序中啟動額外的線程?)
本文介紹了為什么 Windows 10 會在我的程序中啟動額外的線程?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

使用 Visual Studio 2015,在一個新的空 C++ 項目中,為控制臺應用程序構建以下內容:

With Visual Studio 2015, in a new, empty C++ project, build the following for Console application:

int main() {
    return 0;
}

在返回時設置斷點并在調試器中啟動程序.在 Windows 7 上,截至斷點,該程序只有一個線程.但是在 Windows 10 上,它有五個(!)線程:主線程和四個等待同步對象的工作線程".

Set a break point on the return and launch the program in the debugger. On Windows 7, as of the break point, this program has only one thread. But on Windows 10, it has five(!) threads: the main thread and four "worker threads" waiting on a synchronization object.

誰在啟動線程池(或者我如何知道)?

Who's starting up the thread pool (or how do I find out)?

推薦答案

Crystal ball 說 Debug > Windows > Threads 窗口在 ntdll.dll!TppWorkerThread 顯示這些線程.一定要讓 Microsoft 符號服務器自己查看,使用工具 > 選項 > 調試 > 符號.

Crystal ball says that the Debug > Windows > Threads window shows these threads at ntdll.dll!TppWorkerThread. Be sure to enable the Microsoft Symbol Server to see this yourself, use Tools > Options > Debugging > Symbols.

這也發生在 VS2013 中,所以它絕對不是由新的 VS2015 診斷功能引起的,@Adam 的猜測是不正確的.

This also happens in VS2013 so it is most definitely not caused by the new VS2015 diagnostic features, @Adam's guess cannot be correct.

TppWorkerThread() 是線程池線程的入口點.當我在此函數上使用 Debug > New Breakpoint > Function Breakpoint 設置斷點時.當第二個線程池線程開始執行時,我很幸運地為第一個線程池線程捕獲了這個堆棧跟蹤:

TppWorkerThread() is the entrypoint for a thread-pool thread. When I set a breakpoint with Debug > New Breakpoint > Function Breakpoint on this function. I got lucky to capture this stack trace for the 1st threadpool thread when the 2nd threadpool thread started executing:

    ntdll.dll!_NtOpenFile@24()  Unknown
    ntdll.dll!LdrpMapDllNtFileName()    Unknown
    ntdll.dll!LdrpMapDllSearchPath()    Unknown
    ntdll.dll!LdrpProcessWork() Unknown
    ntdll.dll!_LdrpWorkCallback@12()    Unknown
    ntdll.dll!TppWorkpExecuteCallback() Unknown
    ntdll.dll!TppWorkerThread() Unknown
    kernel32.dll!@BaseThreadInitThunk@12()  Unknown
    ntdll.dll!__RtlUserThreadStart()    Unknown
>   ntdll.dll!__RtlUserThreadStart@8()  Unknown

顯然加載器正在使用 Windows 10 上的線程池來加載 DLL.這當然是新的:) 此時主線程也在加載器中執行,并發在工作.

Clearly the loader is using the threadpool on Windows 10 to load DLLs. That's certainly new :) At this point the main thread is also executing in the loader, concurrency at work.

因此,Windows 10 正在利用多個內核來更快地初始化進程.非常重要的功能,而不是錯誤:)

So Windows 10 is taking advantage of multiple cores to get the process initialized faster. Very much a feature, not a bug :)

這篇關于為什么 Windows 10 會在我的程序中啟動額外的線程?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

What is the fastest way to transpose a matrix in C++?(在 C++ 中轉置矩陣的最快方法是什么?)
Sorting zipped (locked) containers in C++ using boost or the STL(使用 boost 或 STL 在 C++ 中對壓縮(鎖定)容器進行排序)
Rotating a point about another point (2D)(圍繞另一個點旋轉一個點 (2D))
Image Processing: Algorithm Improvement for #39;Coca-Cola Can#39; Recognition(圖像處理:Coca-Cola Can 識別的算法改進)
How do I construct an ISO 8601 datetime in C++?(如何在 C++ 中構建 ISO 8601 日期時間?)
Sort list using STL sort function(使用 STL 排序功能對列表進行排序)
主站蜘蛛池模板: a视频在线播放 | www.色五月.com | 日本高清在线一区 | 成人精品视频99在线观看免费 | 日韩欧美亚洲综合 | 精品国产一区二区三区性色av | 成人在线播放网站 | 日本精品视频一区二区三区四区 | 日韩精品在线看 | 毛片日韩| 久久久精 | 日韩综合在线播放 | 国产在线精品一区二区 | 麻豆视频在线看 | 久久久久国产一区二区三区 | 成人小视频在线免费观看 | h网站在线观看 | 在线看黄免费 | 九色视频网 | 久久精品91久久久久久再现 | 欧美日韩视频在线播放 | 99免费精品视频 | 欧美视频免费在线观看 | 成人一区二区电影 | 久久精品中文 | 日本久久综合 | 欧美a∨ | 精品日韩在线 | 国产欧美一区二区久久性色99 | 一级黄色片毛片 | 亚洲精品一区二区在线 | 欧美亚洲国产一区 | 香蕉婷婷 | 国产视频欧美 | 伊人网站视频 | 国产精品日韩 | 欧美久久一区 | 欧美老妇交乱视频 | 日本特黄a级高清免费大片 国产精品久久性 | 成年人视频在线免费观看 | 99久久久无码国产精品 |