473,503 Members | 9,836 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Confused about x64 and c#

Hello,

I need to port a fairly large app to x64, as it needs access to more
than 2GB. So I ported the app to VS2005 (from vs2003). Now the Project
Properties have a Build Tab, which has a Platform Target dropdown. There
is AnyCPU and x64. I've been reading that AnyCPU means that the app
will run in 64 bit mode on a x64 machine and in x86 mode on the 32bit
machine. Is this really the case?

Also, does running an app compiled with AnyCPU on a 64bit box ensure
that it will be able to access more than 2GB, or do I have to compile
for x64 to make that happen?

Are there any performance differences for running on a 64bit box between
AnyCPU and x64 settings?

Are all the intrinsic data types (int, float, etc...) still the same
size in x64 as they are in x86?

Are there any other questions that I should be asking before porting the
app to x64?

Thanks
Aug 4 '06 #1
3 2280
"Frank Rizzo" <no**@none.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Hello,

I need to port a fairly large app to x64, as it needs access to more than
2GB. So I ported the app to VS2005 (from vs2003). Now the Project
Properties have a Build Tab, which has a Platform Target dropdown. There
is AnyCPU and x64. I've been reading that AnyCPU means that the app will
run in 64 bit mode on a x64 machine and in x86 mode on the 32bit machine.
Is this really the case?
Yes, it's really true. And, to be clear, you have to be running the 64bit
version of Windows.

You can also run your app on an Itanium.

>
Also, does running an app compiled with AnyCPU on a 64bit box ensure that
it will be able to access more than 2GB, or do I have to compile for x64
to make that happen?
If you compile for AnyCPU you will still be able to access more than 2GB on
a 64bit OS.
>
Are there any performance differences for running on a 64bit box between
AnyCPU and x64 settings?
I'm sure there are but, I don't know what they are or how extensive the
difference might be. I do know that it's NOT a 32bit/64bit difference.
>
Are all the intrinsic data types (int, float, etc...) still the same size
in x64 as they are in x86?
As far as I know, the only thing that changes size is IntPtr.
>
Are there any other questions that I should be asking before porting the
app to x64?
If you install your app with an MSI installer, you will need two versions,
one for 64 bit and one for 32bit (and maybe one for Itanium) even though the
installers will all be installing the same executable.
Aug 5 '06 #2

Willy.

"Frank Rizzo" <no**@none.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
| Hello,
|
| I need to port a fairly large app to x64, as it needs access to more
| than 2GB. So I ported the app to VS2005 (from vs2003). Now the Project
| Properties have a Build Tab, which has a Platform Target dropdown. There
| is AnyCPU and x64. I've been reading that AnyCPU means that the app
| will run in 64 bit mode on a x64 machine and in x86 mode on the 32bit
| machine. Is this really the case?
|

AnyCPU = runs as 32bit app on 32 bit windows, as 64bit app on 64 bit windows
(assuming v2 of the framework is available).
x64 = only runs on 64bit windows.

| Also, does running an app compiled with AnyCPU on a 64bit box ensure
| that it will be able to access more than 2GB, or do I have to compile
| for x64 to make that happen?
|

What exactly do you mean with accessing "more than 2GB" of memory.
Remember that even on 64 bit, the max size of an CLR object is limitted to
~2GB. That means that , for instance, a managed array can only contain ~2GB
of real data. Sure, on 64 bit you can have multiple 2GB arrays allocated in
memory, something which isn't possible on a 32bit OS.
| Are there any performance differences for running on a 64bit box between
| AnyCPU and x64 settings?
|
No. They both use the same CLR.
| Are all the intrinsic data types (int, float, etc...) still the same
| size in x64 as they are in x86?
|
Yep.

| Are there any other questions that I should be asking before porting the
| app to x64?
|
Yes, what exactly are you after, especially what exactly do you mean with
2GB memory.
Willy.
Aug 5 '06 #3
Willy Denoyette [MVP] wrote:
| Also, does running an app compiled with AnyCPU on a 64bit box ensure
| that it will be able to access more than 2GB, or do I have to compile
| for x64 to make that happen?
|
What exactly do you mean with accessing "more than 2GB" of memory.
Remember that even on 64 bit, the max size of an CLR object is limitted to
~2GB. That means that , for instance, a managed array can only contain ~2GB
of real data. Sure, on 64 bit you can have multiple 2GB arrays allocated in
memory, something which isn't possible on a 32bit OS.
| Are there any other questions that I should be asking before porting the
| app to x64?
|
Yes, what exactly are you after, especially what exactly do you mean with
2GB memory.
No, I do not have an array with 2GB of data. Instead, I have a lot of
object trees (running in different threads) with a bunch of data and the
totality may exceeds 2GB (depending on parameters). Today, I get around
the 2GB limit by running several instances of the application. This is
a pain in the a.. as far as setting up and managing the application.
With 64-bit, I could just have one instance of the application installed
and be done with the maintenance problems.

Anyway, the your and John's answers cleared up the picture for me. It
sounds like the port is going to be a breeze and the result will yield
some definite benefits.

Regards
Aug 7 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
5462
by: Haoyu Zhang | last post by:
Dear Friends, Python assignment is a reference assignment. However, I really can't explain the difference in the following example. When the object is a list, the assignment seems to be a...
2
2603
by: Brian Roberts | last post by:
I'm confused about the use of hasattr/getattr, or possibly namespaces. I know how to do this: class UnderstandThis(object): def do_foo(self): pass def do_bar(self): pass def doit(self, cmd):...
11
4894
by: Ohaya | last post by:
Hi, I'm trying to understand a situation where ASP seems to be "blocking" of "queuing" requests. This is on a Win2K Advanced Server, with IIS5. I've seen some posts (e.g.,...
6
1601
by: ree32 | last post by:
I am a bit confused with capabilities of XML. I have an XML document with information on images(photos). Is there way to use XSL/XSLT to create a page that will display the images as gallery. ...
5
2765
by: Jeff Amiel | last post by:
Yes, I've read the FAQ's... I'm still confused. I'm trying to help out a buddy to extract data from an .mdb file that has special 'permissions' on it. If I try to open it with the standard...
10
3004
by: Lauren Wilson | last post by:
Ok I have searched the MS website for info on this. I am totally confused. If I want to deploy an Access 2003 app and allow my users to run it using Access 2003 Runtime, where do I get the...
1
3248
by: Benny Ng | last post by:
Hi,All, Export Method: ------------------------------------------------------------------------- strFileNameExport = "Results" Response.Clear() Response.Buffer = True...
2
2041
by: Daniel | last post by:
I'm new to .Net and all of its abilities so I hope this makes sense. Basically I'm confused on when is the appropriate time to use web forms controls vs. regular HTML. For example in ASP...
11
3879
by: timmu | last post by:
Someone asked me a question about integer division and printf yesterday, I tell him he should do a casting to float/double before you do any interger division. But he doesn't think so, so I try...
2
6795
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
0
7207
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7095
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7294
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5602
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4693
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1523
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
749
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.