'64位'是什么意思?拉扯问题,但听我说:) [英] What does '64 bit' mean? Lame question, but hear me out :)

查看:72
本文介绍了'64位'是什么意思?拉扯问题,但听我说:)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,首先,让我们把明显的东西拿走。我是个白痴。所以请放纵我一会儿。将其视为社区服务行为....


什么是64位对你友好的邻居C#程序员意味着什么?我从计算机销售人员那里得到的标准答案是:这意味着CPU可以一次处理64位数据而不是32位数据。好的......我想我有点理解这在直觉上意味着什么,但它在实践中意味着什么?请考虑以下代码:


long l = 1;

for(int i = 0; i< 5; i ++){

Console.WriteLine(Emo说+ l);

l + = 1;

}


如何这个代码在64位处理器上的运行方式是否与32位处理器不同?由于指令被处理一次64位,它的运行速度是否会快两倍? 64位(长)变量''''是否会更有效地递增,因为现在它可以在单个处理器指令中完成?


现在我想问一下内存。我认为这是我理解的64位计算的一个好处。在32位系统中,存储器指针在64位系统中只能处理2 ^ 32的过程存储器而不是2 ^ 64的存储器(哇!)。我可以看到这对像SQL Server这样可以轻松分配超过4gig内存的数据库来说是一个主要的优势 - 但对于典型的C#应用​​程序来说这是一个真正的优势吗?


最后,我想问一下互操作性。如果我编译一个32位C#应用程序,它包含的ADO.NET代码是否能够与64位版本的SQL Server进行通信?

感谢您帮助新手,


拉里


Ok, first of all, let''s get the obvious stuff out of the way. I''m an idiot. So please indulge me for a moment. Consider it an act of "community service"....

What does "64bit" mean to your friendly neighborhood C# programmer? The standard answer I get from computer sales people is: "It means that the CPU can process 64 bits of data at a time instead of 32." Ok... I guess I *kind* of understand what that means at an intuitive level, but what does it mean in practice? Consider the following code:

long l=1;
for(int i=0;i<5;i++){
Console.WriteLine("Emo says "+l);
l+=1;
}

How would this code run differently on a 64 bit processor as opposed to a 32 bit processor? Will it run twice as fast since the instructions are processed "64 bits at a time"? Will the 64 bit (long) variable ''l'' be incremented more efficiently since now it can be done in a single processor instruction?

Now I want to ask about memory. I think this is the one benefit of 64bit computing that I DO understand. In a 32bit system, a memory pointer can only address 2^32 worth of process memory versus 2^64 worth of memory (wow!) in a 64bit system. I can see how this would be a major advantage for databases like SQL Server which could easily allocate over 4gigs of memory -- but is this a real advantage for a typical C# application?

Finally, I want to ask about interoperability. If I compile a 32bit C# app, will the ADO.NET code that it contains be able to communicate with the 64bit version of SQL Server?
Thanks for helping a newbie,

Larry


推荐答案

当谈到64位时,我不是大师,但这是我的理解。


64位,就原始速度而言,意思是更快对于某些操作,

虽然可能不是你给出的例子。为什么?因为当移动大量数据时,处理器可以在
时间而不是32位时间移动它们64位。有点像在
高速公路上加倍车道。现在,如果你只是移动一辆车,加倍车道

没有任何区别。它只在高峰时段产生影响。


你对指针的看法是正确的。 64位处理器可以处理比32位处理器多2亿美元的内存。这是很多内存的b
。当然,这就是他们所说的关于64 KB的方式。 :)


就兼容性而言,这就是我所听到的。


您通过ADO与SQL Server交谈的例子。 NET是最简单的回答:一切都会好的。因为ADO.NET和SQL之间的数据移动(通常)是通过网络序列化的,所以两端都不知道另一端使用的是什么样的处理器,甚至是什么语言呢?写了。

啊,脱钩之美。


一个更有趣的问题是你的64位.NET应用程序是否

将能够调用旧的32位DLL来执行操作,反之亦然:

您的32位.NET应用程序是否能够调用

64位编译的DLL来做事情。我知道所有的64位处理器都是内置的32位仿真器,所以他们会降档。运行32位

代码,但我不记得有关一种类型调用

其他的说法。我会把它留给更聪明的人。

I''m no guru when it comes to 64 bit, but here''s my understanding.

"64 bit", in terms of raw speed, means "faster" for some operations,
although likely not the example you gave. Why? Because when moving
large amounts of data around, the processor can move them 64 bits at a
time instead of 32 bits of a time. Sort of like doubling the lanes on a
freeway. Now, if you''re only moving one car around, doubling the lanes
makes no difference. It makes a difference only at rush hour.

You''re right about the pointer thing. 64 bit processors can handle 2
billion times more memory than 32 bit processors. That''s a lot of
memory. Of course, that''s what they said about 64 KB way back when. :)

As far as compatibility, this is what I''ve heard.

Your example of talking to SQL Server through ADO.NET is the easiest to
answer: all will be well. Because data moving between ADO.NET and SQL
Server is (usually) serialized across a network, neither end knows what
processor the other end is using or even what language it''s written in.
Ahh, the beauty of decoupling.

A more interesting question is whether your 64-bit .NET application
will be able to call old 32-bit DLLs to do things, or vice versa:
whether your 32-bit .NET application will be able to call
64-bit-compiled DLLs to do things. I know that all 64-bit processors
have 32-bit emulators built in, so they''ll "downshift" to run 32-bit
code, but I can''t recall what was said about one type calling the
other. I''ll leave that to wiser folk.


AMD有一些关于你可以受益的关键点的白皮书

来自64位编程。

http://www.amd.com/us-en/assets/cont...hite_Paper.pdf


就你的例子而言从32位到64位,它不会产生任何不同的价值。您的应用程序需要编程为

利用额外的系统功能。


考虑哪些游戏可以使用directX 6进行图形处理而不是什么

他们现在可以使用高端视频卡和directX 9.在使用directx 9的系统上运行

古代游戏(想想国王任务)将不会

让游戏看起来更好,你需要写一些东西来获取dx9和硬件可以提供的优势。


DOS app'这是为了使用扩展内存(超过640k

的障碍),在窗户下运行时突然没有使用4gb ram

with ton''在内存方面,他们需要重写以利用

架构。


与64位相同。作为一个典型的程序员,你可能没有注意到你的编码不​​同,但是你可以打赌编译器会知道这些额外的寄存器需要用什么来实现



Larry David写道:
AMD has a whitepaper available on some of the key points you can benefit
from 64-bit programming.

http://www.amd.com/us-en/assets/cont...hite_Paper.pdf

As far as your example goes, from 32 to 64 bit it would make no
difference what so ever. Your application needs to be programmed to
take advantage of the extra system capabilities.

Consider what games could do graphics wise with directX 6 versus what
they can do now with a high end video card and directX 9. Running an
ancient game (think of kings quest) on a system with directx 9 will not
make the game look any nicer, you need to write something to take
advantage of what dx9 and the hardware can offer.

DOS app''s that were written to use extended memory (beyond the 640k
barrier) suddenly didn''t get to use 4gb of ram when run under windows
with ton''s of memory, they needed to be rewritten to take advantage of
the architecture.

Same with 64 bit. As a typical programmer you may not ever notice
different in your coding but you can bet the compiler will know what to
do with those extra registers.

Larry David wrote:
好的,首先,让我们把明显的东西拿走。我是个白痴。所以请放纵我一会儿。将其视为社区服务的行为....

64位是什么?对你友好的邻居C#程序员意味着什么?我从计算机销售人员那里得到的标准答案是:这意味着CPU可以一次处理64位数据而不是32位数据。好的......我想我有点理解这在直觉上意味着什么,但它在实践中意味着什么?考虑以下代码:

long l = 1;
for(int i = 0; i< 5; i ++){
Console.WriteLine(" Emo say") + l);
l + = 1;
}
这个代码如何在64位处理器上运行,而不是32位处理器?由于指令被处理一次64位,它的运行速度是否会快两倍? 64位(长)变量''''是否会更有效地递增,因为现在它可以在单个处理器指令中完成?

现在我想问一下内存。我认为这是我理解的64位计算的一个好处。在32位系统中,存储器指针在64位系统中只能处理2 ^ 32的过程存储器而不是2 ^ 64的存储器(哇!)。我可以看到这对于像SQL Server这样可以轻松分配超过4gig内存的数据库来说是一个主要优势 - 但这对于典型的C#应用​​程序来说这是一个真正的优势吗?

最后,我想要询问互操作性。如果我编译一个32位C#应用程序,它包含的ADO.NET代码是否能够与64位版本的SQL Server进行通信?

感谢您帮助新手,
拉里

Ok, first of all, let''s get the obvious stuff out of the way. I''m an idiot. So please indulge me for a moment. Consider it an act of "community service"....

What does "64bit" mean to your friendly neighborhood C# programmer? The standard answer I get from computer sales people is: "It means that the CPU can process 64 bits of data at a time instead of 32." Ok... I guess I *kind* of understand what that means at an intuitive level, but what does it mean in practice? Consider the following code:

long l=1;
for(int i=0;i<5;i++){
Console.WriteLine("Emo says "+l);
l+=1;
}

How would this code run differently on a 64 bit processor as opposed to a 32 bit processor? Will it run twice as fast since the instructions are processed "64 bits at a time"? Will the 64 bit (long) variable ''l'' be incremented more efficiently since now it can be done in a single processor instruction?

Now I want to ask about memory. I think this is the one benefit of 64bit computing that I DO understand. In a 32bit system, a memory pointer can only address 2^32 worth of process memory versus 2^64 worth of memory (wow!) in a 64bit system. I can see how this would be a major advantage for databases like SQL Server which could easily allocate over 4gigs of memory -- but is this a real advantage for a typical C# application?

Finally, I want to ask about interoperability. If I compile a 32bit C# app, will the ADO.NET code that it contains be able to communicate with the 64bit version of SQL Server?
Thanks for helping a newbie,

Larry




" 64 bit"不是一个明确定义的标签。这意味着CPU里面的东西*

是64位宽但是它没说什么!


一般来说,64位可以预期CPU具有64位的字大小

。 单词是CPU可以传输的数据单元

并且无需将其分成小块即可处理。


所以64位CPU应该是能够以
执行64位整数运算,速度与今天的32位CPU执行32位运算相同。并且

内存地址的大小也应该是64位,这可以为你提供增加的内存范围




但是事情会立即变得有点模糊,因为CPU的*物理*

内存范围很可能被限制在64以下,技术或成本为
比特考虑;例如,早期的英特尔

32位CPU实际上有一个24位内存总线。另一方面,

当前的32位CPU实际上可以在内部处理多达80位,一次是

;但仅限于浮点处理单元(FPU)。


然后就是浪费空间的问题。实际上有很多数据

很适合32位,这就是为什么我们这么慢才能转移到64位系统的原因之一。现在,当你拥有一个64位CPU但是你实际上只需要32位数字时,你有两个选择:打包两个

每个32位数字到64-包装和浪费时间与包装&

打开包装;或者只在64位字中放入一个32位数字,并在主内存和CPU缓存中浪费一半的内存空间!


因此,64位CPU是否真的会加速您的应用程序是否值得怀疑。如果你已经处理了64位整数,那么你只能期望获得显着的收益。同样,增加内存

范围只会让你直接受益,如果你正在翻阅庞大的数据库b $ b;但是,由于操作系统和应用程序往往会变得越来越大,这仍然会让那些一次运行多个程序的用户受益。


从预期收益的角度来看,整个情况与16到32位的价格相差无几。当时每个人都是

不断碰到16位范围,这根本不够,无论是在价值范围还是在价值方面都做了很多有用的工作

内存空间。对于

应用程序,我们正在慢慢耗尽2 GB内存窗口,但它并不重要,32位作为计算范围

已经证明足够了几乎任何东西......

-
http:// www .kynosarges.de
"64 bit" is not a clearly defined label. It means that *something*
inside the CPU is 64 bit wide but it doesn''t say what!

Generally, though, a 64-bit CPU can be expected to have a "word size"
of 64 bit. A "word" is the unit of data that the CPU can transport
and process without having to slice it up into smaller pieces.

So a 64-bit CPU should be able to perform 64-bit integer arithmetic at
the same speed as today''s 32-bit CPUs perform 32-bit arithmetic. And
the size of a memory address should be 64 bit as well, which gives you
the increased memory range you mentioned.

But things immediately get a bit blurry again because the *physical*
memory range of a CPU might very well be restricted to less than 64
bit for technical or cost considerations; for instance, early Intel
32-bit CPUs actually had a 24-bit memory bus. On the other hand,
current 32-bit CPUs can actually process up to 80 bits internally at
once; but only in the floating-point processing unit (FPU).

And then there''s the problem with wasted space. Lots of data actually
fits in 32 bits just fine, which is one reason why we''re so slow to
move to 64-bit systems. Now when you have a 64-bit CPU but you
actually just need 32-bit numbers you have two choices: pack two
32-bit numbers each into a 64-bit word and waste time with packing &
unpacking; or only put one 32-bit number in a 64-bit word and waste
half the memory space, in main memory and in the CPU cache!

So whether a 64-bit CPU will actually speed up your application is
rather doubtful. You can only expect a significant gain if you''re
already processing 64-bit integers. Likewise, the increased memory
range will only benefit you directly if you''re rummaging through huge
databases; however, since operating systems and applications tend to
get bigger and bigger anyway, this should still benefit the user who
runs multiple programs at once.

The whole situation is quite a bit different from the 16-to-32 bit
swtich, from a perspective of expected gains. Back then everyone was
constantly bumping against the 16-bit range which simply isn''t enough
to do much useful work, either in terms of value ranges or in terms of
memory space. We''re slowly exhausting the 2 GB RAM Windows leaves for
apps but it''s not critical yet, and 32 bits as a computational range
have proved sufficient for nearly anything...
--
http://www.kynosarges.de


这篇关于'64位'是什么意思?拉扯问题,但听我说:)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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