Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29280 Discussions

simplest way of sharing a single variable between programs

chunky_lover_23
Beginner
482 Views

I have two programs running indepedently (no parent/child relationships) simultaneously on the same machine.

Does anyone know the simplest way [without using a shared file] that I can change a variable in program 1 and have program 2 read the new value directly from memory.

Clearly SETENVQQ could work if the variable was only changed once and the 2nd program started after the first, but the variable is being continously changed in program 1.

0 Kudos
1 Reply
Steven_L_Intel1
Employee
482 Views

The simplest way is a DLL with a read-write section. See the provided sample DLL_Shared_Data for an example. The shared variable may be a module variable (my preference) or a COMMON.

0 Kudos
Reply