Shared memory for data transfer
Community Forums/General Help/Shared memory for data transfer
| ||
Hi there, what is the best way to implement interprocess communication. Is shared memory the best way to do it and which program out of Blitz Basic, BlitzMax or C is best for IPC? |
| ||
What kind of data do you wish to communicate? Knowing the purpose helps when giving advice. |
| ||
Small stuff like intergers and strings at first, then move onto the composite data. |
| ||
I think there are some windows apis in the code archives for this. Do a search for rtlmovememory (I think thats what it was....been a while) |
| ||
Thanks for that Matty - (RTLcopymemory?) Also the way I understand it, Blitz complies to C in a way that looks after the Garbage collection for you. Does that mean that mean that it is secure in the way of reducing the likelyhood of a buffer overflow attack doing dammage? |
| ||
There is a cross-platform BlitzMax module which does IPC using Boost's Interprocess library. |
| ||
Hi Brucey, if this is the right mod(https://code.google.com/p/maxmods/source/browse/trunk/boost.mod/src/boost/interprocess/ipc/message_queue.hpp?r=1151), where can I find the documentation? Also is it possible to convert from Blitzmax/plus to C or should I just stick to blitzmax/plus? |
| ||
The BlitzMax module source is available here : https://github.com/maxmods/bah.mod/tree/master/interprocess.mod If you are intending on doing IPC stuff in C/C++ (and not actually using BlitzMax), you may prefer to use Boost interprocess itself : http://www.boost.org/ |
| ||
Hi Brucey, since I have no clue when it comes to C, is there a way to convert blitz to C? And is there anything that explains the IPC mod? |
| ||
I'm not sure why, if you don't know C, you need some conversion to C? The glue (glue.cpp) code (that connects BlitzMax to Boost Interprocess) is C++. There are some examples of BlitzMax usage in the examples folder provided - You can browse everything from that first link I provided. The examples themselves are pairs of files (named_mutex/named_mutex2 and shared_memory/shared_memory2). You would run them both at the same time to see the effect of the IPC. BlitzMax generates intermediate assembler, not C. |
| ||
Hi Brucey, my understanding is that DLL's are writen in C and I want to use an include command or a DLL to recycle the code so that many programs can share data. |
| ||
Cool. What language are you writing your "programs" in? If it is a "Blitz" language, you don't need DLLs, as everything you need can be compiled into each binary. |
| ||
I am programing in the blitz languages and what do you mean by compiling to binary? |