|
-
October 25th, 2006, 02:00 PM
#1
Tricky: 2 apps share 1 variable
Here's a tricky problem:
I am programming 2 applications that run seperately from one another. But from time to time they have to pass a piece of information to the other app. This info is of the type INT32.
What I tried is using a database and write this number into it, but I keep on having problems. Maybe that occurs when both apps try to write at the same time.
Is there another way, maybe right within the RAM of the PC where I could store this info. This would be a lot faster than my harddisk with the database on it and thereby reduce the chance of both writing into that space at the same time. The app that reads the data puts a '0' in the DB to show that it has received the data; now before one app tries to put another piece of info there, it checks if the space is "empty" i.e. if there is a '0'. But if the other app also checks for '0' in the small time between the first app checked and then writes its data it may get overwritten by the data from the other app, that also found a '0'. That's why cutting down the time between checking and writing might be critical.
Thanks for any ideas!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|