Aloha again everyone! I'm almost afraid to post another question given
the four-page debate that ensued after my last question!
Anyway, I have a question that's probably surfaced before. I searched
briefly in this forum, but couldn't find anything related. If someone has
answered this before, sorry, and please post a link.
Simply stated, I want a Quick-and-Dirty way of sharing some memory between
two distinct EXE files, both created with PBCC4.
Let's say A.EXE generates about 512 bytes of data. It creates new data
on a non-deterministic timeframe, but usually about 0.5 to 2 Hz. In other
words, every 0.5 to 2 seconds, it has 512 new bytes of data to share.
B.EXE wants the data as soon as possible after it's created. B.EXE is also
non-deterministic, but manages some other near-real-time tasks, so it
cannot be burdened with waiting around for new data.
Originally, I used a simple text file on the hard drive. A.EXE wrote new
data when it was generated, and B.EXE read the same file whenever it had
a chance to do so. The downside was constant drive activity and the necessity
to manage read/write collisions (both EXEs opening the file at the same time).
Then I switched to UDP. It was more elegant, but B.EXE still sometimes sits
around waiting for data. A.EXE sends out data via UDP in-the-blind (it doesn't
know if anyone is listening). But B.EXE has to stop and listen for any broadcasts.
I set the UDP TIMEOUT value low (100 milliseconds), but B.EXE's overall
performance still seems slow. In other words, B.EXE listens for a UDP broadcast
for only 100 milliseconds. If it TIMEOUTS, it gives up completely and tries
again the next time around.
I'm tempted to go back to the text file solution.
Is there a way two distinct EXEs can share 512 bytes of common memory?
And just read and write on-demand? I've even considered converting the data
into 24-bit chunks which can be used as color data for 171 pixels. A.EXE
could plot the pixels and B.EXE could read them. Sounds crazy, but is there
an easier way?
------------------
Christopher Becker
Advanced Airborne Test Facility
Island of Kauai, Hawaii
the four-page debate that ensued after my last question!
Anyway, I have a question that's probably surfaced before. I searched
briefly in this forum, but couldn't find anything related. If someone has
answered this before, sorry, and please post a link.
Simply stated, I want a Quick-and-Dirty way of sharing some memory between
two distinct EXE files, both created with PBCC4.
Let's say A.EXE generates about 512 bytes of data. It creates new data
on a non-deterministic timeframe, but usually about 0.5 to 2 Hz. In other
words, every 0.5 to 2 seconds, it has 512 new bytes of data to share.
B.EXE wants the data as soon as possible after it's created. B.EXE is also
non-deterministic, but manages some other near-real-time tasks, so it
cannot be burdened with waiting around for new data.
Originally, I used a simple text file on the hard drive. A.EXE wrote new
data when it was generated, and B.EXE read the same file whenever it had
a chance to do so. The downside was constant drive activity and the necessity
to manage read/write collisions (both EXEs opening the file at the same time).
Then I switched to UDP. It was more elegant, but B.EXE still sometimes sits
around waiting for data. A.EXE sends out data via UDP in-the-blind (it doesn't
know if anyone is listening). But B.EXE has to stop and listen for any broadcasts.
I set the UDP TIMEOUT value low (100 milliseconds), but B.EXE's overall
performance still seems slow. In other words, B.EXE listens for a UDP broadcast
for only 100 milliseconds. If it TIMEOUTS, it gives up completely and tries
again the next time around.
I'm tempted to go back to the text file solution.
Is there a way two distinct EXEs can share 512 bytes of common memory?
And just read and write on-demand? I've even considered converting the data
into 24-bit chunks which can be used as color data for 171 pixels. A.EXE
could plot the pixels and B.EXE could read them. Sounds crazy, but is there
an easier way?
------------------
Christopher Becker
Advanced Airborne Test Facility
Island of Kauai, Hawaii
Comment