based on some feedback from one of the AsyncThreading users, i realized that the thread messaging system was broken in certain situations. while i had the code open, i took advantage of the opportunity and did a little bit of performance tuning with the Flex profiler. the main performance issue was high instantiation count on some member variables in the guts of the library – this has been resolved.
also, while i was fixing the messaging code, i realized that a thread could have multiple messages of the same type queued up before its next execution cycle. oops. the code is now updated so that a thread only tracks the newest instance of a message for a given message type per execution cycle.
thread a is running on every frame, and thread b is running on every 8th frame. thread a sends a message of ‘hello’ on every execution. by the time thread b executes, its respondToHello() method is invoked 8 times because there are 8 messages of type ‘hello’ sitting in its inbox queue. now, with the updates i mentioned earlier, thread b only invokes respondToHello() once per execution cycle, because it is only keeping a reference to the newest ‘hello’ message that has been sent through the system.
i hope this works out – please ping me if it breaks your code: firstname.lastname@example.org.
anyways, the newest version of the lib can be downloaded from here: