12 Replies Latest reply on Mar 6, 2009 5:58 PM by xfer_rdy

    Multiple Threads

    Level 1
      Can you spawn multiple threads in an AIR application?
        • 1. Re: Multiple Threads
          Oliver Goldman Adobe Employee
          No, you cannot. However, there are other techniques you can use to prevent blocking the main thread. What are you trying to accomplish?

          • 2. Multiple Threads
            Level 1
            Really that is a bummer. I hope Adobe is working on that. Multiple threads are important in application development.

            I have a screen in an application which a lot of components are dynamically added based on an Array of variables. The whole application really blogs down when this screen is painted. I want to spilt the drawing of the screen into multiple parts so the user can still use parts while the rest of the screen is finishing painting.

            Is there another way of handling a situation like this?

            Thank you
            • 3. Re: Multiple Threads
              Oliver Goldman Adobe Employee
              I recommend you look for a way to reduce the number of components being drawn, or otherwise optimize the drawing. I think you'll find that even multi-threaded systems consolidate drawing to a single thread.

              • 4. Re: Multiple Threads
                Level 1
                Do you have any tips for optimize the drawing of components or where I can read more about this?
                • 5. Re: Multiple Threads
                  Oliver Goldman Adobe Employee
                  Use fewer components. I'm not aware of any relevant articles, sorry.

                  • 6. Re: Multiple Threads
                    Level 1
                    I'm sorry to say but if Adobe's answer to sluggish performance when using multiple components on a screen is "Use fewer components." then I have doubts on the longevity and practicality of using AIR for any serious desktop applications.
                    • 7. Re: Multiple Threads
                      xwisdom Level 1

                      Fox9,

                      You might want to add it as a feature request.

                      I think Adobe is trying their best with AIR and Flex but as you know AIR products is very new product and it will take sometime before some features are added. On the other hand they might not have the resources like that of the other guys (SilverLight & JavaFX) but I sure do hope that will pay attention to the things that matters most in an effort to keep and attract new developers.

                      • 8. Re: Multiple Threads
                        Staney G
                        On Ted's blog article, he said that "While the underlying Flash Player and Operating System use threads, the execution model for Actionscript does not."

                        How does Flash Player decide what executable units to be mapped to threads?

                        What the following executable units can be run in separate threads:
                        1) modules loaded into main AIR application
                        2) subapplications loaded into main AIR application
                        3) Multiple AIR applications run on the client's machine
                        • 9. Re: Multiple Threads
                          xfer_rdy Level 1
                          Guys,

                          Don't feel bad, at least you getting an answer.

                          I'm having a similar problem with the file system components. Where the entire app hangs and windows wants to kill it. Worse part about it is, I tried to get air sold in this company saying it was superior to WPF. Not only does it hang and make my team look bad, there is no support from Adobe for "real problems".

                          If you come up with something, please post it. Maybe it will work for file calls. This hanging the application "thing" is unacceptable.
                          • 10. Re: Multiple Threads
                            Damon Edwards Level 3
                            There are some "threading" techniques out there, just takes a little searching: LINKY
                            • 11. Re: Multiple Threads
                              Damon Edwards Level 3
                              This just popped up today too: Linky
                              • 12. Re: Multiple Threads
                                xfer_rdy Level 1
                                Thanks for the tip to linky/ender-lib. It looks like it will work. The real issue, I wouldn't have to do this if FileSystemTree and FileSystemDataGrid worked properly.