Futurescale, Inc. PureMVC Home

The PureMVC Framework Code at the Speed of Thought


Over 10 years of community discussion and knowledge are maintained here as a read-only archive.

New discussions should be taken up in issues on the appropriate projects at https://github.com/PureMVC

Pages: [1]
Print
Author Topic: Is the MultiCore Version multithreading?  (Read 8554 times)
vivoices
Newbie
*
Posts: 2


View Profile Email
« on: May 05, 2010, 09:11:53 »

Does the AS3 MultiCore Version of PureMVC bring multithreading to Flash Builder 4 AIR applications?

Thanks,
David
Logged
jpwrunyan
Sr. Member
****
Posts: 84


View Profile WWW Email
« Reply #1 on: May 06, 2010, 07:14:35 »

I'm going to go out on a limb here and say no.

First of all, Multicore is just a framework.  It does not affect the guts of the flash player, which leads to

Second, flash player cannot multi-thread (http://cookbooks.adobe.com/post_Is_multi_threading_possible_in_Flash_or_ActionScri-12026.html).  There are certain tricks you can do using the enter frame event, however, that may achieve the desired result.  But Multicore does not in and of itself contain any code for formalizing that process.  It's pretty rare to do so by the way.  In our huge spaghetti project, I use the enter frame trick only once to avoid a script timeout.  And meanwhile the dual CPU is chugging along at 50%.

PS
here's someone lamenting the lack of multi-threading in AIR: http://www.flexjunk.com/2009/01/15/multi-threading-in-flexair/
« Last Edit: May 06, 2010, 07:17:01 by jpwrunyan » Logged
vivoices
Newbie
*
Posts: 2


View Profile Email
« Reply #2 on: May 07, 2010, 08:37:57 »

Thanks for your reply,
I was asking, because my imagination was running wild in the direction of:
1. AIR executes like a 'regular' application.
2. OS on multithreading machines can assign different CPUs to individual processes.
3. MultiCore PureMVC uses a separate AIR runtime for each of its MultiCores.
    One of them has a visible window showing the GUI surface.
    The other Cores run in background only.
4. OS assigns a different CPU to each of the PureMVC Cores.
5. PureMVC uses LocalConnections to 'combine forces' of the individual threads.
6. Voila > multithreading AIR application.

But as I said, only my imagination running wild.
 ;)
Logged
jpwrunyan
Sr. Member
****
Posts: 84


View Profile WWW Email
« Reply #3 on: May 10, 2010, 01:45:25 »

Huh.  That is an interesting idea.  I had totally forgotten about LocalConnection.  I've always found it clunky.  But you are probably right, having two independent AIR applications that communicate with one another (one app being the master, the other the slave) might work on separate processors depending on the computer and the OS.  The master or shell could establish the other cores via the local connection I guess???  Is that what you are thinking?  It seems like a major pain, though!  ;)

Maybe someone will come along and make a LocalConnection Multi-thread utility for PureMVC???
Logged
puremvc
Global Moderator
Hero Member
*****
Posts: 2871



View Profile WWW Email
« Reply #4 on: May 10, 2010, 09:04:11 »

Eh, you couldn't guarantee there wouldn't be processor affinity causing all the browser's plugins to run on a single core. That's OS level work.

-=Cliff>
Logged
Pages: [1]
Print