通过产生线程强调CPU [英] Stressing the CPU by spawning threads

查看:97
本文介绍了通过产生线程强调CPU的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

这篇关于通过产生线程强调CPU的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆