I dev开发者_如何学Pythonelop a MIDI application using AIR that read MIDI code from Java and found it could not perform fast enough unless I move everything to Java. In actionscript, does Green thread can improve AIR/Flash by acting as a multithread application which can improve NativeProcess performance in reading and writing?
If not, say would you suggest moving all to Java or choosing Qt framework? I am not comfortable with C++ language.
The Flash player does not provide multithreading support. However, if you are writing a desktop application (using the AIR runtime) you can use a NativeProcess to spawn a commandline tool (python, java, ruby, C, etc etc) to do the Midi processing in the background leaving Flash to just handle the UI updates, which is what Flash is really all about.
Green threading can be a useful approach for some data processing tasks that slow down the framerate but I suspect that your MIDI processing is quite intensive - it probably does not belong in Flash.
If you are deploying to the web, then using a Java (or any other server-side resource) for MIDI processing is your best bet. You'd have to provide more detail on the type of processing if you want me to get more specific.
精彩评论