什么是32位还是64位系统.NET之间的区别是什么?区别、系统、NET

2023-09-03 11:40:43 作者:_知己不可当情人*

想象一下,一个纯粹的.NET应用程序,它不使用COM组件,也不PInvoke的。它是否重要,如果目标系统是32位还是64位?

Imagine a pure .NET application which do not uses COM components nor PInvoke. Does it matters if the target system is 32 or 64 bits?

推荐答案

假设安全code没有COM组件,P / Invoke的,等等。应该没有语义差别,但性能可能会受到影响。试想一下:更多的内存在64位,但引用是更大的。赢得一些,失去一些。

Assuming safe code with no COM components, P/Invoke, etc. there should be no semantic difference, but performance may be impacted. Consider: More memory under 64-bit, but references are bigger. Win some, lose some.

总之,这里有一些有用的参考资料:

Anyway, here are a few useful references:

查看 MSDN:迁移32位管理code至64位。报价: See MSDN: Migrating 32-bit Managed Code to 64-bit. Quote:

[...]考虑一个.NET应用程序   这是100%的安全类code。在这   场景就可以把你的   您运行在.NET可执行的   32位机,并将其移动到   64位系统,并运行它   成功。为什么这项工作?   因为大会是100%类型安全   我们知道,有没有相关性   原生code或COM对象和   不存在不安全code,这意味着   该应用程序完全运行   在CLR的控制。在CLR   保证了在二元code   即作为结果而产生的   刚刚在实时(JIT)编译会   在32位和64位的不同,   一个执行都将是code   语义相同。 [...]

"[...] Consider a .NET application that is 100% type safe code. In this scenario it is possible to take your .NET executable that you run on your 32-bit machine and move it to the 64-bit system and have it run successfully. Why does this work? Since the assembly is 100% type safe we know that there are no dependencies on native code or COM objects and that there is no 'unsafe' code which means that the application runs entirely under the control of the CLR. The CLR guarantees that while the binary code that is generated as the result of Just-in-time (JIT) compilation will be different between 32-bit and 64-bit, the code that executes will both be semantically the same. [...]"

另见的猫腻的博客:64位VS 32位

Also see Maoni's WebLog : 64-bit vs 32-bit

另请参见斯科特Hanselman的计算机禅 - 歌姬:32位和64位 周围的x86混乱和x64

Also see Scott Hanselman's Computer Zen - Back to Basics: 32-bit and 64-bit confusion around x86 and x64