多物理CPU机器上的CPU指令

发布于 2024-11-24 13:42:23 字数 128 浏览 2 评论 0原文

我有两个问题: 1.一台机器可以有两个或多个不同型号的CPU吗? 2. 如果我调用CPUID指令,不同CPU执行时结果会有所不同吗? (如果问题1的答案是正确的,这是显而易见的)。如果是这样,我怎样才能通过CPUID指令获取所有CPU的信息。

I have 2 questions:
1. Can a machine have two or more CPUs which are different in model?
2. If I call CPUID instrucion, will result be any different when different CPUs perform it? (If the answer to quesions1 is right, this is obvious). If so, how can I get all CPUs' infomation by CPUID instrucion.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

海夕 2024-12-01 13:42:23

是和不是。有许多系统具有多个处理器,并且差异很大。 Gameboy Advance,同时具有基于 Arm 和基于 z80 的 Gameboy(不能同时使用两者)。但nds有arm9和arm7(可以/确实可以同时使用两者)。您会在 beagleboard 中找到的 omap 有一个手臂和一个 TI DSP(可以同时使用两者)。我假设您谈论的是 x86 系统。大多数台式机只是 x86。您的鼠标和键盘以及类似的东西可能有 8051 或其他各种类型的微控制器。但您并不关心,因为这些只是 USB HID 设备或 cdrom 驱动器或硬盘。你无法真正接触到处理器,所以它是否出现并不重要。笔记本电脑和高端服务器系统以及可能的台式机很快就会有第二个处理器或计算机,对于笔记本电脑来说,它可能是一个手臂,功耗显着降低,因此 x86 可以在待机模式下关闭,手臂保持活力,你把它叫醒,它就会很快出现。在服务器上,另一个系统作为防弹看门狗,监视服务器,提供监控和一些远程重置以及其他功能。同样,您无法访问该处理器,因此即使您在 CPUID 交易中找不到也没关系。另一种是你的显卡,有数百到数千个 GPU。您可以使用您的程序访问这些信息,就像使用 omap dsp 一样,但您不进行通用处理,因此 CPUID 也不需要提供该信息。

所以是和不是。您的计算机系统作为一个整体,包括外围设备,具有许多不同的处理器,但通用处理通常是同一系列的单核或多核,通常位于同一芯片内。因此,CPUID 只需要为您提供该核心/系列。

Yes and no. There are many systems that multiple processors, and vastly different. The gameboy advance, has both the arm based and z80 based gameboy (cannot use both at the same time). but the nds has an arm9 and arm7 (can/do use both at the same time). The omap you would find in a beagleboard has an arm and a TI dsp (can use both at the same time). I assume you were talking about x86 systems. Most desktops are just an x86. Your mouse and keyboard and things like that probably have 8051s or other various flavors of microcontrollers. But you dont care because these are just USB HID devices or cdrom drives or hard disks. You cant really get at the processor so it doesnt matter that it shows up. Laptops and high end server systems and likely dekstops soon have a second processor or computer in there, for the laptop it is probably an arm, significantly lower power, so the x86 can be turned off in a standby mode, the arm keeps things alive, you wake it up it comes up very fast. On a server the other system is there as a bulletproof watchdog, keeps an eye on the server, provides monitoring and some remote reset and other capabilities. Likewise you cant get at this processor so it does not matter if you cannot find in a CPUID deal. Another one is your video card, hundreds to thousands of gpus. You can get access to those with your programs, as with the omap dsp, but you dont do general purpose processing so again the CPUID wouldnt need to provide that info.

So yes and no. Your computer system as a whole, including peripherals, has many different processors, but the general purpose processing is usually a single or multicore of the same family usually inside the same chip. So CPUID only really needs to give you that core/family.

不乱于心 2024-12-01 13:42:23

为此,您必须区分“套接字”“核心”,因为术语“处理器”是不明确的。

CPUID 为您提供有关当前套接字的信息,即当前线程正在执行的核心所在的套接字(包含 CPUID 操作码的线程)。

只要兼容,不同的套接字可以包含略有不同的硬件,因此:

要获取有关不同套接字的信息,您必须确保您的进程在相关套接字上执行:您可以命令操作系统在其上运行线程某个套接字,但这是特定于操作系统的。搜索引擎:为操作系统中的线程设置处理器关联性

CPUID 将告诉您需要了解的有关当前插槽的所有信息,包括“逻辑处理器”的数量:逻辑处理器数量等于核心数量,如果您的核心不是超线程,如果它们是超线程,那么逻辑处理器数量将加倍。

For this you have to distinguish between "sockets" and "cores" because the term "processor" is ambiguous.

CPUID gives you the information on the current socket, meaning the socket on which the core sits in which the current thread is executing (the thread that contains the CPUID-opcode).

Different sockets can contain slightly different hardware as long as they are compatible, so:

To get the information about a different socket you have to make sure your process gets executed on the socket in question: You can order your operating system to run your thread on a certain socket but that is OS-specific. Search-engine: setting processor affinity for a thread in your OS.

CPUID will tell you everything you need to know about the current socket, including the number of "logical processors": the logical processor count is equal to the number of cores if your cores are not hyperthreaded, if they are hyperthreading then the logical processor count will be double.

风轻花落早 2024-12-01 13:42:23

我假设您的问题中存在 cpuid 意味着 x86/x64 上下文。

多插槽主板(实际上是 BIOS)通常要求所有已安装的处理器报告相同的 cpuid 信息,即完全相同。我想可能会有架构相同但频率不同的处理器,但是 mb 制造商必须列出哪些组合可以工作,哪些组合不能工作,并回答无数的电子邮件,询问为什么这个或那个所谓的兼容组合不起作用。

I assume that the presence of cpuid in your question means an x86/x64 context.

A multi-socket motherboard (bios actually) usually requires all installed processors to report the same cpuid info i e be exactly the same. I guess it could be possible to have processors that are architecturally equal but with differing frequencies but then the mb manufacturer would have to list which combos work and which don't and answer endless emails about why this or that supposedly compatible combo doesn't work.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文