InvestorsHub Logo
icon url

sgolds

04/08/03 11:51 AM

#2048 RE: yourbankruptcy #2019

yourbankruptcy, your 64-bit application switch idea is enticing although it does have practical issues. This level of programming is not allowed for an application, but the application could employ a special kernel-level driver and take over the processor. A custome API based on IOCTL routines is then employed between the app and the driver. In order to get the performance boost you want the machine running in 64-bit mode by default and then running other 32-bit code as the exception. Frequently used OS routines need to be recoded in 64-bit or you will get killed by all the context changes. These are limited to certain graphics, audio and input routines, so it is a containable set. If the app is intensively running 90% of the CPU cycles then you will see significant performance improvement.

The sticky problem is that the OS is still running in 32-bit mode. The application would need to essentially put a wrapper around the OS and run it in its own 32-bit space. All the 32-bit calls from the OS will need to be intercepted and run by the wrapper, which would then be a super-OS.

I think that is more than Doom would want to do!
icon url

wbmw

04/08/03 12:19 PM

#2052 RE: yourbankruptcy #2019

YB, Re: If the app is executed under 32-bit Windows, but really needs to perform some heavy calculations, it can turn off interrupts, switch to the 64-bit mode, calculate something using all new registers for, say, 1 ms, then switch back into 32-bit mode and enable interrupts.

1. Turning off interrupts is very dangerous. First, there are several that are non-maskable, and need to be run for proper CPU operation. 1ms is far too long to go without interrupts. RTOS operation is supposed to handle interrupt requests within 50us, though Windows usually takes 100-300us. Even so, 1ms is much too long. Lastly, some interrupts control the timing of the system, which allows for proper scheduling within the OS. You cannot turn these off and still allow the OS to function correctly.

2. You cannot switch modes within a processor without specific instructions. How is the processor supposed to know you want to run in 64-bit mode? Those instructions have special op-codes, but the instructions being read for a 32-bit app do not have those opcodes. So how would the processor know? It only does what it's told, that's how electronics work. Sorry, but you can't enable magic operation, even with clever programming.