2 Replies Latest reply on Dec 4, 2008 10:44 AM by rsarma

    Thread Safety

    rsarma
      I am new to flex and I wonder how flash player/flex handles threads.
      I have a remote object and a consumer - the result event (and message event) from both these processes will have to manipulate the same array collection object that I have declared as a member of the application.
      Question: Would the functions defined for message event (from the consumer) and the result event (from the remote object) be executed concurrently or sequentially (in case the events happen to fire at the same time)?

      Thanks,
      Ram
        • 1. Re: Thread Safety
          rtalton Level 4
          The rpc calls are asynchronous and you cannot predict when you'll get the results. There are no threads.
          If you need the results of both before proceeding I suggest you call one first, and in its result handler, call the second one. In the result handler of the second call, you will now have both results to work with in the form of both the rpc call's lastResult object.
          • 2. Re: Thread Safety
            rsarma Level 1
            thanks for your response rtalton.