Thread: Porting from 32 bit machine to 64 bit machine!

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    57

    Porting from 32 bit machine to 64 bit machine!

    Hi,
    First of all apologies if this is not the right forum.

    This is a first of its kind for me. There is an existing 32 bit C application that needs to be ported to a 64 bit machine. Now apart from taking care of pointers, size of int, conversions, Endian-ness, so and so forth, there is something else that has to be answered.

    Perhaps the question will be vague and ideas incoherent. So please bear with me.

    I have been asked to also find out, what can be suggested by us to the end customers as a good reason to increase RAM (why the same increase would not do the trick in a 32 bit machine, but in 64 bit machine)?

    So lets take a 32 bit machine with 512 MB RAM.

    The virtual process address space is 2 ^32 - 1.

    In a 64 bit machine it will increase to 2 ^64 - 1.

    But will the increase in the RAM, not be beneficial in both the cases? I mean, and I could be wrong here, I think the question is perhaps not correct technically, since an increase in the RAM will help in either case.

    Putting it more strictly, can there be a case when an increase in the RAM would only benefit a 64 bit application on a 64 bit machine, and not a 32 bit application on a 32 bit machine?

    Any pointers as to how to proceed to investigate will be highly appreciated.

    Thanks in advance,
    Anoop.
    Intelligence: Finding an error in a Knuth text.
    Stupidity: Chasing that $2.56 cheque you got.

    Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live.

    If Java had true Garbage collection, most programs would delete themselves upon execution.

  2. #2
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    64 bit can have a load more ram whereas 32 bit is restricted to 4gb max. We are quickly moving towards that 4gb ceiling so it is a good idea to switch to 64 bit now.

  3. #3
    Registered User
    Join Date
    Mar 2002
    Posts
    57
    lol yes, that would be the physical limit and in real world perhaps not many end users would like to match that limit.

    Anoop.
    Intelligence: Finding an error in a Knuth text.
    Stupidity: Chasing that $2.56 cheque you got.

    Always code as if the person who ends up maintaining your code will be a violent psychopath who knows where you live.

    If Java had true Garbage collection, most programs would delete themselves upon execution.

  4. #4
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    Quote Originally Posted by anoopks
    lol yes, that would be the physical limit and in real world perhaps not many end users would like to match that limit.

    Anoop.
    640kb ought to be enough for anyone. - Bill Gates
    Last edited by Brian; 02-23-2005 at 02:28 PM.

  5. #5
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    No need to go to 64-bit yet until it has been tried and tested. I'm not paying to be someone else's guinea pig.

    It's just a bigger pipe anyways.

  6. #6
    ---
    Join Date
    May 2004
    Posts
    1,379
    >>It's just a bigger pipe anyways.

    You say it like it is no big deal. Maybe it isn't yet, but 64-bit is the next gen of personal computers.

  7. #7
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Actually the next generation is 3 state devices or 4 state devices. Then there are of course bio-electrial devices after that.

    To answer the OP's orignal question: Unless you made assumptions there is nothing you really need to do to convert. The majority of what'll change is how big certain objects are. But if you are using good methods (like sizeof(int) instead of 4) then you'll be just fine.

  8. #8
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    You may be interested in this article series: Old New Thing: Summary of the recent spate of /3GB articles

    >> But will the increase in the RAM, not be beneficial in both the cases? <<

    Extra RAM will only be beneficial if the system or your program is using the extra memory available.

  9. #9
    Registered User
    Join Date
    Jan 2005
    Posts
    14
    If you’re dealing with numbers larger than 32 bits 64 bit processors are faster as they don’t need to split the number up into two parts as a work around. A larger instruction set has also been introduced to improve the efficiency of the. Fedora produce a 64 bit open source operations system.

    More that 4GB of memory is quite limited unless you count the forth-coming version of windows. Other uses may include massive graphic files or video editing. Bear in mind that sticks of RAM of 2GB cost more that 5 times as much as a 1GB stick.

    Benefit will depend on the type of app you have written, an office application will see no benefit whereas a maths package may well. You would be wise to wait a couple of months as dual core 64 bit processors are just around the corner hopefully.
    Currently Reading:

    Mathematic from the birth of numbers,
    Effective TCP/IP programming,
    Data Compression: The Complete Reference,
    C Interfaces and Implementations: Techniques for Creating Reusable Software,
    An Introduction to Genetic Algorithms for Scientists and Engineers.

  10. #10
    The C-er
    Join Date
    Mar 2004
    Posts
    192
    64 bit is a must (soon).

    My bro does 3D design using Rhino, and it struggles with *only* 1.25 GB RAM with the complex models he produces. With windows having a 2GB limit per process, there's not much headroom now.

    Also I'd like to write stuff with a 64 bit processor in mind for performance reasons. Remember the x86-64 architecture gives the register-starved 386 model some much needed registers, which compilers will like.

  11. #11
    Registered User
    Join Date
    Feb 2005
    Posts
    19
    If Java had true Garbage collection, most programs would delete themselves upon execution.
    This is so true! Anyways, getting back to the main topic... Switching from 32 bit to 64 bit is good for someone who writes programs that need vast quantities of memory. Examples would be search engines or graphics based games. Being a person who writes tiny programs that could very well run on a 286 I wouldn't be able to tell you how much of a better performance you would get out of a 64 bit machine other than more memory and faster additions. If you follow the language standard well, i.e. use ints and sizeof() you should be fine. C tends to be a very portable language. You can probably compile something on a 32 bit machine from a 16 bit machine like a 286. I work on a 32 bit machine but like I said my programs probably could run on a 16 bit machine and probably even a 64 bit one although that would not do anything for me. Bottom line - think of moving up from a 32 bit machine to a 64 bit machine as moving from a 16 bit machine to a 32 bit machine. If I remember a 16 bit machine could only access 1 MB? Right? Bitmaps used to only be able to fit into 64 KB segments. Now they can take up 4 GB. So what's going to have to change is not your program but the resources that it accesses and how it does it. If you are fine with the current size of your resources then your work is done. I guarentee it!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File IO
    By Jack1982 in forum C++ Programming
    Replies: 9
    Last Post: 10-15-2007, 01:14 AM
  2. If the RGB color is (64, 64, 255), change it to (64, 255, 64).
    By Grayson_Peddie in forum C# Programming
    Replies: 2
    Last Post: 06-14-2003, 04:26 PM
  3. How do I print 64 bit unsigned integer in hex?
    By electrolove in forum C Programming
    Replies: 7
    Last Post: 02-11-2003, 12:43 PM
  4. 64 bit variables
    By Yawgmoth in forum C Programming
    Replies: 11
    Last Post: 12-19-2002, 01:55 PM
  5. 16 bit or 32 bit
    By Juganoo in forum C Programming
    Replies: 9
    Last Post: 12-19-2002, 07:24 AM