I am using a SharedObject to communicate between two different swfs, i.e. the sender writes a prop to it, and the receiver, who is polling, looks for the value. This works 99% of the time, but occasionally all of the properties are being deleted, as if I had called clear() on the SharedObject.
After much investigation, I determined that this happens only when one object is trying to read while the other is writing. I had set up another SharedObject as a mutex, but I only used this to ensure that one and only one program is trying to write at any given time. I figured the worst case of a read in the middle of a write would be some obsolete data, which would be taken care of by the next poll.
I made a test program where, every 10 ms, the program reads a property on the SharedObject, increments it, and writes it back (via flush()). This works just fine, until I run another instance. Then the madness begins.
It doesn’t seem to matter if flush() returns an error or not. I even do another getLocal() after flushing and check the value, and its correct (even when flush returns a 2130 error). However, sometime between then and the next time I try again, the shared object is destroyed (size = 0) and all my data is lost.
Has anyone seen anything like this before?
I’ve attached my sample test.as file, if that’s helpful at all.