使用带有X64 bit vc ++应用程序的intel处理器的超线程 [英] Hyper-Threading with intel processors with X64 bit vc++ application

查看:57
本文介绍了使用带有X64 bit vc ++应用程序的intel处理器的超线程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在64位VC ++应用程序中使用汇编或不汇编在Intel Pentium 4以后的处理器上启用或禁用超线程? 

How to identify Hyper Threading is enabled or Disabled on the Intel pentium 4 onwards processors using assembly or without assembly in 64 bit VC++ application? 

推荐答案

< p style ="margin:0px 0px 10.66px"> 试试这个:

#include
< intrin.h>

。 。 。

int r [4];

if ((__ cpuid(r,0),r [0])> 0)

{

      
__ cpuid(r,1);

       __cpuid( r, 1 );

      
int EDX = r [3];

 

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;
bool hyperthreading_supported =(EDX&(1<< 28))!= 0;

 

      
//。 。 。

}


这篇关于使用带有X64 bit vc ++应用程序的intel处理器的超线程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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