-4

Here is my source code for testing multithread performance in C++. Please tell me why is time about 5x smaller for ONE thread running(WaitForMultipleObject()) then first sequential performance. I expect almost same result for sequential performance and running with only one thread. Thanks

http://pastebin.com/EeJ5qW03

4

1 回答 1

2

操作系统将决定您的线程何时开始运行,它还将决定是否需要调度。除此之外,它还必须为您的线程创建一个单独的堆栈,也许。

阅读有关线程创建的开销。总而言之,开销是系统特定的。

于 2012-07-12T00:14:58.007 回答