Login | Register  
Latest 20 PostsMinimize
28 Aug 2010 08:51 PM
RE: MONO - Fastalanasa
28 Aug 2010 01:51 AM
RE: MONO - Taliesen
28 Aug 2010 01:31 AM
RE: MONO - Fastalanasa
27 Aug 2010 04:10 PM
RE: MONO - Taliesen
27 Aug 2010 03:16 PM
RE: MONO - Fastalanasa
27 Aug 2010 09:26 AM
RE: MONO - Karak
27 Aug 2010 05:04 AM
RE: MONO - Taliesen
25 Aug 2010 04:00 PM
RE: MONO - Fastalanasa
25 Aug 2010 04:49 AM
RE: MONO - Taliesen
23 Aug 2010 04:19 AM
RE: MONO - Fastalanasa
23 Aug 2010 02:57 AM
23 Aug 2010 02:54 AM
RE: MONO - Taliesen
23 Aug 2010 02:52 AM
RE: MONO - Fastalanasa
23 Aug 2010 02:36 AM
RE: MONO - Fastalanasa
23 Aug 2010 02:13 AM
RE: Stat System - Fastalanasa
23 Aug 2010 01:57 AM
23 Aug 2010 01:34 AM
23 Aug 2010 01:32 AM
23 Aug 2010 01:30 AM
23 Aug 2010 01:07 AM
ForumsMinimize
Difference between x86 and AnyCPU
Last Post 13 Jun 2010 06:30 AM byFastalanasa. 11 Replies.
Printer Friendly
Sort:
NextNext
You are not authorized to post a reply.
AuthorMessages
FastalanasaUser is Offline
Grumpy Half-Elf
Advanced Member
Advanced Member
Send Private Message
Posts:705
Avatar

--
09 Sep 2009 08:13 AM  

I always have a hard time explaining why mixed OS in developer groups should use x86 instead of AnyCPU. I found an article that explains it in a real life context. The source for the article is here: http://laputa.sharpdevelop.net/Shar...fault.aspx

SharpDevelop now creates projects as 32-bit by default

Starting with SharpDevelop 3.1 RC2, new projects are created with a "Target CPU" setting of "x86". Previously, projects were created as "AnyCPU". This change affects only new projects; existing projects keep their old setting.

Now, what is the difference between these settings? On 32-bit Windows, there isn't any. But on 64-bit Windows, for programs, the "x86" setting means your program will run as a 32-bit process in the "Windows on Windows" emulation layer. AnyCPU programs would run as a native 64-bit process.
For libraries, the new setting will prevent them from being loaded into 64-bit processes.

Now, restricting stuff to 32-bit doesn't sound like it's the way forward. Why did we do this change?

   1. If you never test on 64-bit Windows, the new setting ensures your program will run in compatibility mode. This is better than breaking on your user's 64-bit machines because you unknowingly had 32-bit-only code in your program.
   2. The SharpDevelop debugger does not yet support 64-bit processes.
   3. Microsoft did the same change: Visual Studio 2010 also creates x86 projects by default.

The main problem with the target processor is that you cannot mix libraries with different processor types. If your program is running as 64-bit process, it cannot load 32-bit libraries. If your program is running as 32-bit process, it cannot load 64-bit libraries.
If you have an existing AnyCPU solution and add new projects to it using SharpDevelop 3.1, you should change the target CPU of all new projects back to AnyCPU.

As soon as your program depends on an unmanaged library, you will be forced to pick the corresponding processor type (e.g. SharpDevelop includes 32-bit SQLite and Subversion, so it must run as a 32-bit process). Unless your program is completely managed, AnyCPU is a bad idea because you would have to load a different unmanaged library depending on the process type your program got loaded into.

For purely managed libraries, the situation is different. Here I must recommend to use AnyCPU to allow your library to be loaded into any process type. In fact, in the case of SharpDevelop, only the executable (SharpDevelop.exe) is marked as 32-bit; all other libraries are AnyCPU.

KarakUser is Offline
Locutus of WheelMUD
Advanced Member
Advanced Member
Send Private Message
Posts:501
Avatar

--
15 Sep 2009 05:12 AM  
Nice. Maybe we should get rid of the 'any cpu' option until such time as we can effectively fix and test it on 64-bit machines and such? (I've found recently that adding x86 to a project that was missing it was easy, I imagine it would be the same for x64 or 'any cpu' options)
KarakUser is Offline
Locutus of WheelMUD
Advanced Member
Advanced Member
Send Private Message
Posts:501
Avatar

--
27 Apr 2010 09:35 AM  
Just wanted to resurrect this with a better angle: Would anyone object to the removal of 'Any CPU'? This may save new-user headaches.
FeverdreamUser is Offline
Basic Member
Basic Member
Send Private Message
Posts:177
Avatar

--
27 Apr 2010 03:37 PM  
Removal as in replacement with 'x86'?

I'm not against it, in fact I really don't see it can do any harm.
FastalanasaUser is Offline
Grumpy Half-Elf
Advanced Member
Advanced Member
Send Private Message
Posts:705
Avatar

--
16 May 2010 07:42 PM  
Posted By Karak on 27 Apr 2010 02:35 AM
Just wanted to resurrect this with a better angle: Would anyone object to the removal of 'Any CPU'? This may save new-user headaches.

Not at all. If it is not there, then people can mess with it.

FeverdreamUser is Offline
Basic Member
Basic Member
Send Private Message
Posts:177
Avatar

--
07 Jun 2010 02:54 AM  
This was checked in, right?
KarakUser is Offline
Locutus of WheelMUD
Advanced Member
Advanced Member
Send Private Message
Posts:501
Avatar

--
07 Jun 2010 09:16 AM  
Hmm, looks like I never did this. Oops. If someone wants to do this, it should be quick change, I'm just not in a place where I could get to submitting soon since I have so many other things still broken.
FeverdreamUser is Offline
Basic Member
Basic Member
Send Private Message
Posts:177
Avatar

--
08 Jun 2010 07:40 AM  

I made the change as best I could just now for the express solution.. but the NCalc code did not have it as an option for me.

 

Somebody else will need to check the main solution file and if needed, tweak for the NCalc as I see its generating heavy warnings and is being worked on anyway.

FastalanasaUser is Offline
Grumpy Half-Elf
Advanced Member
Advanced Member
Send Private Message
Posts:705
Avatar

--
08 Jun 2010 08:51 PM  
Posted By Feverdream on 08 Jun 2010 12:40 AM

I made the change as best I could just now for the express solution.. but the NCalc code did not have it as an option for me. 

Somebody else will need to check the main solution file and if needed, tweak for the NCalc as I see its generating heavy warnings and is being worked on anyway.

I fixed both issues, and checked them in.

KarakUser is Offline
Locutus of WheelMUD
Advanced Member
Advanced Member
Send Private Message
Posts:501
Avatar

--
09 Jun 2010 07:47 AM  
Sweet! Thanks guys!
FeverdreamUser is Offline
Basic Member
Basic Member
Send Private Message
Posts:177
Avatar

--
13 Jun 2010 06:16 AM  
Ok so can we consider this done?

Just looking for confirmation..
FastalanasaUser is Offline
Grumpy Half-Elf
Advanced Member
Advanced Member
Send Private Message
Posts:705
Avatar

--
13 Jun 2010 06:30 AM  
Aaaaaaaye, it's done! - Tommy Undergallows
You are not authorized to post a reply.

Active Forums 4.2
Copyright 2007-2010 by WheelMUD  | Terms Of Use | Privacy Statement
Google Analytics Alternative