2 Replies Latest reply on Apr 8, 2008 9:01 AM by

    Thread safety/synchronization?

      Flex/AS doesn't appear to have any overt synchronization mechanism, is it handled under the covers (ie is every method synchronized?) or is it user beware?

      I have data this is manipulated by both a timer and the ui and I'm wonder how to keep things synchronized... any ideas? (Don't do it isn't an option.)

      Thanks-- Mike
        • 1. Re: Thread safety/synchronization?
          riesvantwisk Level 1
          Flex player is single threaded, thus you don't need to synchronize.

          However if your data get's updated at both ends, then you need to handle that for your situation. By setting a lock boolean and because flex is single threaded you can be assured that the boolean get's accessed by only one function at a time. Hope I made myself clear?

          Ries
          • 2. Re: Thread safety/synchronization?
            Hmm... so what you're saying is that Flex owns the event loop and everything that is dispatched runs to completion?

            Any idea if this includes Blaze & Weborb?

            Sounds like I shouldn't write a spin-lock :-)

            Thanks-- Mike