.NET 在 32 位或 64 位系统中的区别是什么? [英] What are the differences between .NET in 32 or 64 bit systems?

查看:24
本文介绍了.NET 在 32 位或 64 位系统中的区别是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

想象一个不使用 COM 组件和 PInvoke 的纯 .NET 应用程序.目标系统是 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?

推荐答案

假设安全代码没有 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:

"[...] 考虑一个 .NET 应用程序那是 100% 类型安全代码.在这场景有可能采取你的您在您的计算机上运行的 .NET 可执行文件32 位机器并将其移动到64位系统并运行成功地.为什么这样做?由于组件是 100% 类型安全的我们知道没有依赖关系在本机代码或 COM 对象上没有不安全"代码,这意味着应用程序完全运行在 CLR 的控制下.CLR保证,而二进制代码产生的结果是即时 (JIT) 编译将是32位和64位的区别,执行的代码都将是语义相同.[...]"

"[...] 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. [...]"

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