C Board  

Go Back   C Board > General Programming Boards > C Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 02-23-2005, 01:36 PM   #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.
anoopks is offline   Reply With Quote
Old 02-23-2005, 01:45 PM   #2
Registered User
 
Join Date: Jan 2002
Location: Cardiff
Posts: 2,219
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.
Brian is offline   Reply With Quote
Old 02-23-2005, 01:47 PM   #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.
anoopks is offline   Reply With Quote
Old 02-23-2005, 02:25 PM   #4
Registered User
 
Join Date: Jan 2002
Location: Cardiff
Posts: 2,219
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.
Brian is offline   Reply With Quote
Old 02-24-2005, 12:12 AM   #5
Super Moderator
 
Bubba's Avatar
 
Join Date: Aug 2001
Posts: 7,819
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.
__________________
If you aim at everything you will hit something but you won't know what it is.
Bubba is offline   Reply With Quote
Old 02-24-2005, 12:36 AM   #6
Registered User
 
Join Date: May 2004
Posts: 1,362
>>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.
__________________
sand_man is offline   Reply With Quote
Old 02-24-2005, 12:48 AM   #7
& the hat of GPL slaying
 
Thantos's Avatar
 
Join Date: Sep 2001
Posts: 5,732
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.
Thantos is offline   Reply With Quote
Old 02-24-2005, 03:01 AM   #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.
anonytmouse is offline   Reply With Quote
Old 02-24-2005, 04:39 AM   #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.
CBUK is offline   Reply With Quote
Old 02-25-2005, 04:51 PM   #10
Jez
The C-er
 
Join Date: Mar 2004
Posts: 186
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.
Jez is offline   Reply With Quote
Old 02-25-2005, 08:02 PM   #11
Registered User
 
Join Date: Feb 2005
Posts: 19
Quote:
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!
fungus_mungus is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

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


All times are GMT -6. The time now is 06:11 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22