如何使用Windows 7的所有内核? [英] How to use all the cores in Windows 7?

查看:156
本文介绍了如何使用Windows 7的所有内核?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道这是否属于计算器或超级,但我想我会问这里。

I am not sure if this belongs to Stackoverflow or Superuser but I thought I would ask here.

我用C编写一个控制台应用程序基于目前需要一个小时左右在Windows 7 64位操作系统终止。任务管理器报告说,应用程序使用只有25%的可用的CPU。我想通过增加CPU使用率,减少运行时间。

I have a console based application written in C which currently takes about an hour to terminate in Windows 7 64-bit OS. The task manager reports that the application is using only 25% of the available CPU. I would like to reduce the run time by increasing cpu usage.

有没有什么办法可以让应用程序中使用的所有四个核心(笔记本电脑拥有酷睿i5),而不是只有一个?我假设,因为只有一个核心分配给程序,任务管理器报告25%。

Is there any way to let the application use all four cores (the laptop has Core i5) instead of just one? I am assuming that task manager reports 25% because only one core is allocated to the program.

推荐答案

而无需重新编写应用程序是多线程=不,你不能改变应用程序的行为。
你可能可以做的唯一一件事,就是如果应用程序能够处理输入数据的范围,就可以启动4个实例输入数据的不同范围的应用程序来处理,他们都完成后的结果结合起来。

Without re-writing the app to be multi=threaded no, you can't change the behavior of the app. The only thing that you might can do, is if the app can process ranges of input data, then you can launch 4 instances of the app with different ranges of input data to process and the combine the results after they are all done.

试想渲染3D动画和
  渲染器是单线程的,但
  您可以指定开始和结束帧。
  你有100帧渲染你
  将开始4个实例,并指定
  开始和结束帧范围0 - 25,26
   - 50,51 - 75,76 - 100。然后你所有的输出结合起来,你的
  最终的电影文件。

Imagine rendering a 3D animation and the renderer is single threaded, but you can specify start and end frames. You have 100 frames to render you would start 4 instances, and specify start and end frame ranges 0 - 25, 26 - 50, 51 - 75, 76 - 100. Then you would combine all the outputs to your final movie file.

这篇关于如何使用Windows 7的所有内核?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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