通过产生线程强调CPU线程、CPU

由网友(心高气傲、)分享简介:我的工作,我们打算用它来模拟用户的工作在系统上的应用程序。目标之一是让很多用户执行任务,强调测试的应用程序。I'm working on an application which we're going to use to simulate users working on a system. One of the...

我的工作,我们打算用它来模拟用户的工作在系统上的应用程序。目标之一是让很多用户执行任务,强调测试的应用程序。

I'm working on an application which we're going to use to simulate users working on a system. One of the goals is to stress test the application by letting a lot of users perform tasks.

一个用户只是一个BackgroundWorker在这一点上。现在,无论有多少'用户'我重生,核的CPU负载永远不会通过屋顶。

A user is simply a backgroundworker at this point. Now, no matter how many 'users' I spawn, the CPU load of the cores never gets through the roof.

现在,我是pretty的新的线程,但我最好的猜测是,这是由于硬件的限制,在这种情况下,4个内核。该内核被置工作,之后,它的时间片只是一个问题。

Now, I'm pretty new to threading, but my best guess is this is due to the hardware limit of, in this case, 4 cores. The cores get set to work and after that it's just a matter of timeslicing.

有什么方法可以解决吗?我想强调的所有内核尽可能多地。

Are there any ways to work around this? I'd like to stress all cores as much as possible.

推荐答案

VS2010有pretty的良好的负载测试功能。我的一个同事写了一篇博客上的模拟g多个用户的此处。其基础是写几个单元测试在你的用户执行最常见的操作,然后让VS负载测试做多的用户对你的工作。

VS2010 has a pretty good Load Test functionality. One of my co-workers wrote a blog post on simulationg multiple users here. The basis for this is to write a few unit tests around the most common operations your users perform and then let the VS Load Test do the multi user work for you.

阅读全文

相关推荐

最新文章