64 bit vs 32 bit

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »

52 Replies - 4961 Views - Last Post: 26 November 2009 - 04:12 PM

#1 Anarion  Icon User is offline

  • The Persian Coder
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,514
  • Joined: 16-May 09

64 bit vs 32 bit

Posted 03 October 2009 - 10:31 AM

Hi Everyone! I have a question :D
What are the differences between 64 and 32 bit in C++ ? I just know 64bit allows bigger variables like integers with size of 8 bytes. And do you guys prefer a 64bit system ? Any increase in code execution ?
Is This A Good Question/Topic? 0
  • +

#3 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4437
  • View blog
  • Posts: 12,308
  • Joined: 18-April 07

Re: 64 bit vs 32 bit

Posted 03 October 2009 - 10:53 AM

64/32 bit has all to do with the addressable memory limits, variables and other types of data and how wide they are. A 32 bit system could only access memory addresses that fit with a 4 octet name. This is why 32 bit Windows systems were limited to only 4GB of RAM. It also meant that the system would take 32 bit chunks at a time out of memory, down the pipe to a processor which would work on that 32 bits for things like floating point math and other calculations (which is why variables and such in C++ were based on variables of this width).

Of course moving to 64 bit means you can access larger memory addresses (more than 4GB of RAM), faster retrieval (grabbing 64 bits of data at a time) and can process it with larger values (hence variables like integers being larger and floating point can be done with bigger values).

Now the question is, is it all gain and no pain to go to 64 bit? Of course not. There are draw backs right now, but those drawbacks are slowly shrinking.

Sometimes an application developer writes software thinking that it will be working on a 32 bit system. Things like hardware drivers need to know the target system and what it can handle. Otherwise you can run into hardware issues with devices that think they are using 32 bit Operating Systems. So the first problem is that you may have are driver issues unless the hardware manufacturer releases a 64 bit driver... which they are more and more but it is not guaranteed. Software itself can also handle things like threads differently or be limited based on the idea of a 32 bit system. So you may find that some software will experience problems, crashes or other oddities on a 64 bit system. Which is why you may even see software companies releasing two versions of their software... one for 32 bit and one for 64.

The last thing I want to address is that I am talking about a full 64 bit system, not a system with just a 64 bit processor. I currently run a 64 bit AMD chip, but my system is still 32bit elsewhere. I run a 32 bit OS (XP) and write software based on the 32 bit platform. With the 64 bit chip I do get faster processing since it can take in wider data, but my system is still only going to give it 32 bits and limit the amount of RAM I can access.

I would say it is getting more and more safe to switch to 64 bit systems now, but the longer you can wait the better it will be for you experience wise I think. Or if you want to jump into it now, take a check of all your hardware you currently have and make sure they have 64 bit drivers.

Hope that helps explain a bit. :)

This post has been edited by Martyr2: 03 October 2009 - 10:54 AM

Was This Post Helpful? 1
  • +
  • -

#4 Anarion  Icon User is offline

  • The Persian Coder
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,514
  • Joined: 16-May 09

Re: 64 bit vs 32 bit

Posted 03 October 2009 - 11:18 AM

:D That was a complete explaining, and helped me many bits!. Thank You!
Because I use a dual boot with windows, my Linux is 64bit but my windows is 32bit. so far, I could use it with no bad problems :)
Was This Post Helpful? 0
  • +
  • -

#5 NickDMax  Icon User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2250
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: 64 bit vs 32 bit

Posted 03 October 2009 - 01:11 PM

I was one of the poor souls who went with windows XP 64... what a waste!

Don't get me wrong the 64bit programs run nicely and some are even optimized for 64bit and things are definitely sweet. The 8Gig of RAM makes running VM's very nice (I run linux VM web-servers for development).

But as Martyr2 alluded to there are many problems with compatibility.

My girlfriend has taken to pointing and laughing every time some program will not install on the 64bit system. Everything for iTunes to the DVR software for our FiOS -- a few games. Much of the time this is actually not a fault with the 64bit OS but the vendors' installers. The OS can run 32bit programs so long as they don't try to get too low-level (drivers for example must be 64bit).

No 16bit programs will run at all... this is kind of sad because I had a lot of 16bit programs from Ye Olde DOS Days. This also makes it harder to help out in the assembly forum here since many of the questions are for 16bit Ye Olde .com files.

Anyway... I like the 64bit as a workhorse/Development platform -- but for a casual PC Windows XP 64 has been a poor choice. -- I am waiting for Windows 7 which I hope will be more compatible with today's "pop software". (It would be so nice to have iTunes to accompany my iPod).
Was This Post Helpful? 0
  • +
  • -

#6 Anarion  Icon User is offline

  • The Persian Coder
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,514
  • Joined: 16-May 09

Re: 64 bit vs 32 bit

Posted 04 October 2009 - 01:43 AM

My journey to computers is from 6 years ago... it's not a long time and therefore I have no serious issues with 64bit... currently my windows is a mess because of a virus and the worst thing is that it's Vista! it crashes whenever I login... now I just miss my iTunes! :blink: I haven't synced my iPhone near a month. But other than that, 64bit is better for me... this Divine app I made runs much faster now and I'm happy for that :D

But I agree, for windows 32bit is the way to go (for these days at least). I am looking forward to 7 but I will love my Linux always. :D
Was This Post Helpful? 0
  • +
  • -

#7 NickDMax  Icon User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2250
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: 64 bit vs 32 bit

Posted 04 October 2009 - 11:42 AM

Quote

No 16bit programs will run at all... this is kind of sad because I had a lot of 16bit programs from Ye Olde DOS Days. This also makes it harder to help out in the assembly forum here since many of the questions are for 16bit Ye Olde .com files.

I should mention that since the system does run VM's well that all of the 16bit programs CAN be run on the VM -- but what needs to happen in better integration of a VM...

ANYWAY as far as 64bit programming goes. There are some things that need to be taken into consideration. For example the kind of memory model you are using: In windows it is flat with a 64bit pointer, but 32bit integer.

There is often a lot of "waste" in 64bit systems. For example pointers are 64bit... but most programs don't need a 64bit pointer -- they are not trying to address 18,446,744,073,709,551,616 bytes of memory (though most hardware actually limits this anyway). But since pointers are 64bits all 64 bits get written to memory. A big reason to not use 64bit integers as a default integer size (breaking a long standing tradition of an int representing the "word size" or register size of a processor) is that most uses of integers already don't need all 32bits. How many times have you used an int to calculate the length of a string... what were the chances that the string would be longer than 32,767 (16bit signed value's max). Were you thinking that the string might be 2,147,483,647 bytes long (assuming you used a singed int.)? Of course we don't do this capriciously -- wisdom tells us that there processor will work faster with its full register size chunks then having to read/write half or quarter the size chunks. i.e. it is faster to calculate the length of a string using an integer than it is using a short or a byte.

This works well enough for 32bit systems... but at modern processor speeds the real killer of performance is cache misses. IF you are wasting cache space with a bunch of unused bytes (indeed the majority of the cache would be wasted) you would be doing more harm than good to make 64bit integers your workhorse go-to-integer type.

If you are doing calculations that use 64bit wide chunks of data (i.e. encryption, large number numerical processes, image processing, video processing) then the 64bit architecture is not wasting space but is taking larger bites! (no pun intended) of your data to process. The result is generally improved speed.

but many problems deal with much smaller data elements and the algorithms used often have to be re-worked to deal with the larger data size efficiently. -- OR just waste a bunch of memory and gain no noticeable improvement over 32bit programs.
Was This Post Helpful? 1
  • +
  • -

#8 Anarion  Icon User is offline

  • The Persian Coder
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,514
  • Joined: 16-May 09

Re: 64 bit vs 32 bit

Posted 05 October 2009 - 11:46 AM

In my program, I was using a 10 byte buffer for file reading/writing (i mean the char[] used to get and put data). but now I changed it to 1024. But I guess it should be more than that ?

Edit: is 64 bit systems, is manipulating larger arrays faster? i mean with far more elements in data reading for files

This post has been edited by Anarion: 05 October 2009 - 12:06 PM

Was This Post Helpful? 0
  • +
  • -

#9 NickDMax  Icon User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2250
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: 64 bit vs 32 bit

Posted 05 October 2009 - 12:14 PM

well... a profile would be the direction to really go to get the answer for this, but generally when reading data from a file I always use a buffer of at least 1024 -- just make sure that it is a multiple of 8 bytes (64bits).
Was This Post Helpful? 0
  • +
  • -

#10 Anarion  Icon User is offline

  • The Persian Coder
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,514
  • Joined: 16-May 09

Re: 64 bit vs 32 bit

Posted 06 October 2009 - 11:00 AM

I see... now I'm using a buffer with 1024*1024 bytes and it's going fast enough for me now
Was This Post Helpful? 0
  • +
  • -

#11 NickDMax  Icon User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2250
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: 64 bit vs 32 bit

Posted 06 October 2009 - 02:15 PM

So you made a 1MB buffer... now see that seems excessive to me... but what do I know. Maybe your file is 64Gb and you have plenty of ram... but I generally keep my buffering down to a few Kb's Maybe as high as 64kb but even that seems kind of out there.

How big is the file you are buffering?
Was This Post Helpful? 0
  • +
  • -

#12 Anarion  Icon User is offline

  • The Persian Coder
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,514
  • Joined: 16-May 09

Re: 64 bit vs 32 bit

Posted 07 October 2009 - 11:28 AM

Hmm, it all depends on the file I want to split... but my original purpose was for bigger files, at least more than a couple of Gigabytes (like a dvd9 image file from a movie)... that may seem useless but I have further more plans for this code, a new kind of encryption algorithm I made (still in progress). but I still want to use it for smaller files too.

It works like this: you put some files together as one, and when storing them, the program changes the order of joining them based on a formula... I call this file a pool (like swimming pool with lots of stuff in it). So the bigger the pool is, the better security you get. So, this file may be like 50GB in large scale.

This kind of encryption might sound stupid for others... but I have a very strong need for it (it's kinda secret, I might have to transfer the movies I took past months and don't want the security guys catch them because if so, I will be dead :D).

Edit: How much buffer is enough for this task? and my ram is 1GB currently, but I may upgrade it to 4 in next year

This post has been edited by Anarion: 07 October 2009 - 11:31 AM

Was This Post Helpful? 0
  • +
  • -

#13 Ancient Dragon  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 81
  • View blog
  • Posts: 679
  • Joined: 19-July 09

Re: 64 bit vs 32 bit

Posted 08 October 2009 - 01:30 PM

I am using 64-bit Vista Home Premium dual booted with 64-bit Fedora 11. The only problems I have had is Abode Flash lack of 64-bit support. IE can play all YouTube videos and movies on DVDs, but FireFox can not because it lacks Flash driver. FF has the same problem in Fedora. The mouse driver in Fedora does not work well either -- my wireless mouse freezes often and I have to reboot in order to fix it. Vista does not have that problem at all.

One of my favorite games that I played a lot on 32-bit XP will not play on Vista, I don't know if its because Vista is 64-bit or because its just Vista.

Before Vista, I had tried to install 64-bit XP but quickly replaced it with 32-bit XP because of lack of drivers -- i.e. not even a 64-bit screen driver was available for it. 64-bit Vista fixed all those problems.

This post has been edited by Ancient Dragon: 08 October 2009 - 01:31 PM

Was This Post Helpful? 0
  • +
  • -

#14 Anarion  Icon User is offline

  • The Persian Coder
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,514
  • Joined: 16-May 09

Re: 64 bit vs 32 bit

Posted 08 October 2009 - 01:35 PM

For your flash problem in firefox, there is a package you need to install... i couldnt get it to work with adobe's own download, i got it from debian's repository and now it works. my system is Debian Lenny 64bit.
Was This Post Helpful? 0
  • +
  • -

#15 ccubed  Icon User is offline

  • It's That Guy
  • member icon

Reputation: 162
  • View blog
  • Posts: 1,409
  • Joined: 13-June 08

Re: 64 bit vs 32 bit

Posted 09 October 2009 - 07:44 PM

Hmm. I have Vista 64 Bit and all I did for firefox was download flash from adobe. Maybe they fixed it?
Was This Post Helpful? 0
  • +
  • -

#16 Anarion  Icon User is offline

  • The Persian Coder
  • member icon

Reputation: 310
  • View blog
  • Posts: 1,514
  • Joined: 16-May 09

Re: 64 bit vs 32 bit

Posted 10 October 2009 - 03:29 AM

I don't know why, but when I downloaded from adobe's website , it didn't work for me, so I just used Debian's repository and installed the flash-player from there, then in worked fine :)
Was This Post Helpful? 0
  • +
  • -

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »