Skip to main content
Participant
May 25, 2013
Question

Is there a plan to let concurrent be support by AIR on mobile?

  • May 25, 2013
  • 1 reply
  • 1045 views

Expecting this feature from AIR 3.4, but till this edition, there is still no support concurrent on mobile device. Is there a plan to support this in the future?

This topic has been closed for replies.

1 reply

Jeff__Ward
Inspiring
May 29, 2013

Yes, this is a critical feature.  And I even looked into using C threads via FlasCC, but FlasCC uses Workers to accomplish this under the hood (aka - it won't work on mobile.)

Does anyone know if threading is possible using ANEs?  Is it possible to write a cross-platform ANE (even just iOS and Android) that would allow you to write heavy data processing in C, and provide some sort of uniform ByteArray data-passing logic for the ANE layer - i.e. say for image analysis.

Participant
May 29, 2013

I wrote plenty of multi-threaded C++ code for Windows and wrapped it up within ANEs.  Obviously, you have to be careful and sync to your single ANE->AIR thread.  I'd imagine the same applies for other platforms.

See http://help.adobe.com/en_US/air/extensions/WS39e706a46ad531be-fd70de2132a8f3874e-8000.html
For example "dispatchStatusEventAsync"

Call this function to dispatch an ActionScript StatusEvent event. The target of the event is the ActionScript ExtensionContext instance that the runtime associated with this FREContext object.

Typically, the events this function dispatches are asynchronous. For example, an extension method can start another thread to perform some task. When the task in the other thread completes, that thread calls dispatchStatusEventAsync() to inform the ActionScript ExtensionContext instance.

Jeff__Ward
Inspiring
May 29, 2013

Thanks Alan.  I also found a relevant Stackoverflow post that confirms:

http://stackoverflow.com/questions/12038436/does-native-extension-code-in-adobe-air-for-ios-run-in-a-separate-cpu-thread

Seems like we could build a generic background-processing ANE with basic ByteArray-passing to support at least some manner of mobile threading.  It'd be ideal if both Android and iOS (and even better, desktop platforms too) could support a common base language (like C) for the application-specific logic.

I could think of many uses for this - especially image or audio processing.  I'm guessing passing ByteArrays between native and AS3 could be the limiting factor for performance...  But these concerns are the same when using AS3 Workers.

Fascinating, maybe I'll have to play with this...