I have a need to distribute algorithms over a network without really knowing what algorithms being transfer. Therefor I figure why not try to send the data pointed to by the function identifier and try to send it over the network.
My first attempt was to use a script engine in which I could embed my algorithms. Problem being the efficiency!
Does anyone know of any already existing research in this area or perhaps some articles?
Specifically I'm interested in find out how the effects would be on memory and how to deal with the fact that the memory allocation might differ on diffrent machines.
I'm sure there are some haxxors out there that know how this would work.
Thanks in advanced for any help.
Accessing functions as memory in C/C++ at run-time.
Started by GroundKeeper, Jun 01 2007 07:07 PM
6 replies to this topic
#1
Posted 01 June 2007 - 07:07 PM
#2
Posted 01 June 2007 - 09:31 PM
I don't know what platform you're working on, but the best bet would be to send over a shared library such as a DLL containing your algorithm, and load it on the other side.
You could also do a binary copy of a function if the compiler does not reorder functions inside your executable and your function does not call other functions. However, that might be troublesome as some regular operations even call other functions (such as the conversion of float to int)
You could also do a binary copy of a function if the compiler does not reorder functions inside your executable and your function does not call other functions. However, that might be troublesome as some regular operations even call other functions (such as the conversion of float to int)
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.
-
Currently working on: the 3D engine for Tomb Raider.
#3
Posted 02 June 2007 - 10:09 AM
have a look at RAIL and Brakes
http://www.bat.org/~tomba/monoco.html
http://blog.secondli...threading-mono/
I don't think you'll find anything like them for C++
http://www.bat.org/~tomba/monoco.html
http://blog.secondli...threading-mono/
I don't think you'll find anything like them for C++
#4
Posted 02 June 2007 - 12:37 PM
Thanks for the feedback!
My plattform would be targeted against Win32, Xbox 360 and perhaps Playstation 3. But initially I have a requirement for a Win32 implementation.
Dll:s crossed my mind. Might even be the best way to go. The problem will be speed. Haven't really done any analyse of what type of operations that will be the time consumers but the more to send on the network the more time you need to spend of sending is/was my initial thoughts. But in contrast of the data transfer of the algorithm the actual algorithm is a one-time transfer.
You actually convince me that the only sane method is a dll.
To actually manipulate the program sequence might be problematic.
On the other hand I don't know of what kind of dll capability the Xbox and Playstation has. Will have to find out.
Thanks guys!
My plattform would be targeted against Win32, Xbox 360 and perhaps Playstation 3. But initially I have a requirement for a Win32 implementation.
Dll:s crossed my mind. Might even be the best way to go. The problem will be speed. Haven't really done any analyse of what type of operations that will be the time consumers but the more to send on the network the more time you need to spend of sending is/was my initial thoughts. But in contrast of the data transfer of the algorithm the actual algorithm is a one-time transfer.
You actually convince me that the only sane method is a dll.
To actually manipulate the program sequence might be problematic.
On the other hand I don't know of what kind of dll capability the Xbox and Playstation has. Will have to find out.
Thanks guys!
#5
Posted 02 June 2007 - 04:38 PM
The Playstation 3 can be run with a special distribution of Linux, so you can use its .so (shared object) functionality, which works similiarly to Windows DLLs. I don't know much about the XBox360 OS, except that it was originally based on Windows 2000, but has been completely reengineered along the way. It most likely still supports some kind of dynamic linking, but you'd have to get docs from Microsoft to figure out how to make it work.
reedbeta.com - developer blog, OpenGL demos, and other projects
#6
Posted 03 June 2007 - 10:03 PM
Is this about official gamecode or homebrew?
For native code, the 360 can handle DLLs like Windows does (LoadLibrary()), but I don't know what XNA's options are (but since it's basically just .Net you could probably dynamically load assemblies)
As for the PS3 and Reedbeta's remark, while linux is especially relevant for homebrew stuff, it is not for official games. I don't know whether games can load dynamic libraries (I imagine they could), but if it's official you should have the documentation so you could check for yourself
For native code, the 360 can handle DLLs like Windows does (LoadLibrary()), but I don't know what XNA's options are (but since it's basically just .Net you could probably dynamically load assemblies)
As for the PS3 and Reedbeta's remark, while linux is especially relevant for homebrew stuff, it is not for official games. I don't know whether games can load dynamic libraries (I imagine they could), but if it's official you should have the documentation so you could check for yourself
C++ addict
-
Currently working on: the 3D engine for Tomb Raider.
-
Currently working on: the 3D engine for Tomb Raider.
#7
Posted 04 June 2007 - 07:56 AM
.oisyn said:
Is this about official gamecode or homebrew?
For native code, the 360 can handle DLLs like Windows does (LoadLibrary()), but I don't know what XNA's options are (but since it's basically just .Net you could probably dynamically load assemblies)
As for the PS3 and Reedbeta's remark, while linux is especially relevant for homebrew stuff, it is not for official games. I don't know whether games can load dynamic libraries (I imagine they could), but if it's official you should have the documentation so you could check for yourself ;)
For native code, the 360 can handle DLLs like Windows does (LoadLibrary()), but I don't know what XNA's options are (but since it's basically just .Net you could probably dynamically load assemblies)
As for the PS3 and Reedbeta's remark, while linux is especially relevant for homebrew stuff, it is not for official games. I don't know whether games can load dynamic libraries (I imagine they could), but if it's official you should have the documentation so you could check for yourself ;)
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












