Memory resident executables?

Blitz3D Forums/Blitz3D Programming/Memory resident executables?

ervin(Posted 2008) [#1]
Hi all.

I've got a little program which calls an executable using ShellExecute. This happens a number of times in my program, and of course the hard disk activity has an impact on my program's performance.

Does anyone know if it is possible to hold the external executable in memory, and running it from there?

Can something like this be done with banks?

Thanks for any help.


Zethrax(Posted 2008) [#2]
Your best bet might be to convert the executable to a dynamic link library (if it is practical to do so) and call it using either CallDll or the userlibs system.


ervin(Posted 2008) [#3]
I don't think I can do that though I'm afraid.
The executable I am calling is one of the programs in the ImageMagick suite, and so is a precompiled binary distribution.

Looks like I'm stuck with it the way it is.


jfk EO-11110(Posted 2008) [#4]
One approach may be to run it from an USB stick or SD card. They got pretty fast ones too. THen again, if you consider WIndows is caching harddisk access anyway, so I'm not sure if you really have such an impact because of harddrive access (as long as the file is not altered). If it's a small exe then it's very likely that the OS is holding it in the cache ram.


Dreamora(Posted 2008) [#5]
Or if it is just for your purpose, use a RAM Drive. There is a free driver for XP.

Otherwise there is no way. Code Execution Protection won't allow you to execute an application from data memory which is the only place you can "upload" your application to.


ervin(Posted 2008) [#6]
Thanks for the replies everyone.

Unfortunately it's not just for my own purposes (I hope to release the program in a few months).
I do use a RAM disk on my PC, and it's wonderful, but I can't depend on it for this project. :o(

It's ok though - I've found a sneaky way to minimise the reliance on ImageMagick, so my program still runs quite quickly.