CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2003
    Posts
    375

    Can 64-bit software run on 32-bit Windows?

    I know many 32-bit software programs designed and built for 32-bit Window XP or 7 can also run on 64-bit Windows 7. However, can 64-bit software programs run on 32 bit Windows? Thanks!

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Can 64-bit software run on 32-bit Windows?

    No. On 64-bit systems there is an emulator that allows the 32-bit programs to run. This emulator 'fakes' out the 32-bit programs into thinking they're running on a 32-bit OS.

  3. #3
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Can 64-bit software run on 32-bit Windows?

    32-bit software runs on 64-bit Windows because of a Windows sub-system called Windows on Windows 64-bit, or shortly WoW64. This emulates the 32-bit system. You can read more here: http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx.

    As Arjay said, there is no similar emulator to allow 64-bit apps to run on 32-bit Windows. That's why, if you want to target 32-bit Windows (which is still available on lots of machines) you must have two versions, one for 32-bit and one for 64-bit.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  4. #4
    Join Date
    Aug 2008
    Posts
    902

    Re: Can 64-bit software run on 32-bit Windows?

    I don't know if I would call it an emulator per se. When people think of emulators, they think of processors being emulated with code, which is slow. 32-bit apps run just as fast in 64-bit operating system because 64-bit CPUs can execute 32-bit instructions while inside a 64-bit OS.

  5. #5
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Can 64-bit software run on 32-bit Windows?

    Yes, however, 32-bit application in WoW64 mode do have a slight performance overhead. Same version of the app, but naively build for 64-bit should get a performance boost between 1-5% just because WoW64 is no longer involved. Probably not something that you'd observe with a naked eye, though.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  6. #6
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: Can 64-bit software run on 32-bit Windows?

    This isn't necessarily true...

    There is an overhead to a lot of API calls (the ones that end up needing the kernel), because the call in 32bit code at some point needs to be marshalled to 64bit, but this overhead is very minimal, though if you would do thousands of those API calls in a loop you'll notice it. But... calls requiring the kernel are all notoriously slow anyway because of the ring switch. The performance penalty lost there makes the marshalling overhead be a drop in a bucket of water.
    There is a reason why Win64 comes with actual full versions of the Win32 dlls and doesn't just have dummy Win32 dlls's that always thunk into the Win64 calls. Those thunk DLL's would be considerably smaller than the full 32bit ones, so from a technical point of view this would have made more of the 2Gb (3Gb for large address aware) address space of the Win32 app available for the app to play with, but thunking every single API call from 32 to 64 and back, would make this terribly slow. There is no marshalling overhead at all on a vast majority of API calls simply because the 32bit dlls's are loaded into the 32bit address space.

    64bit code tends to be slightly bigger/bulkier, this means it'll make less efficient use of the CPU code cache and prefetch, and has a bigger working set.
    In addition, pointers are twice as big, 'ints' tend to be 64 bit as well and this puts extra strain on the data cache.

    Highly optimised and tight code, will usually be faster on 32bit because of that. The code the majority of us C++ programmers write on a daily basis however doesn't fall into this category (even if you account for compiler optimised loops).

    64bit apps will tend to be (or seem to be) more performant because machines with Win64 tend to have more RAM than a 32bit machine. And having plenty of RAM is a big boon on windows. Even 32bit apps will typically run better on the same machine with Win64 assuming it has more than 3Gb RAM. Simply because the OS can keep more of the working set in RAM and can make more use of disk cache at the same time.

    64bit apps wil also be faster when dealign with 64bit math (although to be fair, I don't see a lot of this type of code )
    And some apps may be made more performant because of a bigger address space (although without actual RAM to back this, it could be the reversedue to paging).


    With 99% of the apps out there, you won't notice any kind of difference.
    With the 1% of apps where performance will matter.
    Assuming you have a machine with Win64 and Win32 in dual boot:
    - Win32app on Win32 will be faster than Win32app on Win64 if you have less than 3Gb ram.
    - Win32App on Win64 is typically going to be faster than Win32App on Win32 if you have more than 3Gb ram. Any marshalling overhead will be cancelled out by more efficient use of memory.
    - Win32App on Win64 is typically going to faster than Win64App on Win64 because of a smaller code and data thus making better use of the L1 and L2 CPU cache.
    - Win64App (on Win64) will be significantly faster than the similar Win32app if the app benefits from lots of memory (audio/image/video editing being big obvious examples) simply because memory is king and for these type of apps memory will make a bigger differnce than CPU speed.

    Again, the above is generalisation and high performance tends to not do well with generalisation rules, but it is a good rule of thumb.

  7. #7
    Join Date
    Jan 2003
    Posts
    375

    Re: Can 64-bit software run on 32-bit Windows?

    I will install the 64-bit and 32-bit Windows operating systems on same computer, this can ease the test.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured