c - Create a DLL to share memory between two processes -


i need use dll's function similar linux shared memory. have little windows programming experience, think possible accomplish goal. want similar below:

dll

int x;  void write(int temp) {   x = temp }  int read() {  return x; } 

process 1:

loaddll(); write(5); //int x = 5 

process 2:

loaddll(); printf(read()); //prints 5 since int x = 5 proccess 1 

naturally example neglects race conditions , like, there simple way go this?

i using microsoft visual studio 10 create dll. explain how write simple , build dll can loaded , called similar pseudo-code above?

edit: shared memory segments , memory mapped files cannot used because processes creating in labview , lua not support above. do, however, support dlls why need "outdated" approach.

by default, each process using dll has own instance of dlls global , static variables.

see here.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -