Forum Topic: Dose AS3 support threads etc

(150 views • 13 replies)

This topic is 1 page long.

<< < > >>
None

Jon-86

Reply To Post Reply & Quote

Posted at: 9/25/09 05:04 AM

Jon-86 NEUTRAL LEVEL 13

Sign-Up: 01/30/07

Posts: 3,890

A simple question dose it have support for threads or another mechanism allowing you to implement something that's more responsive, by having some calculations taken care of by a separate process so it doesn't cause a perceived block.

And if so, is their any interprocess communication mechanisms to get threads talking to each other?

PHP Main :: C++ Main :: Java Main :: irc.freenode.net

BBS Signature

None

Glaiel-Gamer

Reply To Post Reply & Quote

Posted at: 9/25/09 05:06 AM

Glaiel-Gamer NEUTRAL LEVEL 27

Sign-Up: 12/28/04

Posts: 8,053

using pixel bender to batch process data is the closest you'll get to doing threading in flash.


None

dELtaluca

Reply To Post Reply & Quote

Posted at: 9/25/09 05:07 AM

dELtaluca LIGHT LEVEL 20

Sign-Up: 04/16/04

Posts: 5,548

As far as I'm aware the only way to do multithreading... is with a PixelBender filter :P

Which is a shame, but there you are :/

My social worker says im special!

BBS Signature

None

dELtaluca

Reply To Post Reply & Quote

Posted at: 9/25/09 05:09 AM

dELtaluca LIGHT LEVEL 20

Sign-Up: 04/16/04

Posts: 5,548

Unless you felt like writing a program in another language doing the work for you with as many threads as you like, and communicate with it over a BinarySocket :P

My social worker says im special!

BBS Signature

None

Jon-86

Reply To Post Reply & Quote

Posted at: 9/25/09 05:10 AM

Jon-86 NEUTRAL LEVEL 13

Sign-Up: 01/30/07

Posts: 3,890

Ach well, cheers for the info folks, I will look into that and see if it has any use for what I'm trying to make.

PHP Main :: C++ Main :: Java Main :: irc.freenode.net

BBS Signature

None

Jon-86

Reply To Post Reply & Quote

Posted at: 9/25/09 05:11 AM

Jon-86 NEUTRAL LEVEL 13

Sign-Up: 01/30/07

Posts: 3,890

At 9/25/09 05:09 AM, dELtaluca wrote: Unless you felt like writing a program in another language doing the work for you with as many threads as you like, and communicate with it over a BinarySocket :P

I replied too soon, thats a good idea. I would rather keep the code in one place but that idea might have a use :)

PHP Main :: C++ Main :: Java Main :: irc.freenode.net

BBS Signature

None

dELtaluca

Reply To Post Reply & Quote

Posted at: 9/25/09 05:13 AM

dELtaluca LIGHT LEVEL 20

Sign-Up: 04/16/04

Posts: 5,548

Or as glaiel points out, swf's can communicate with eachother too, so if you could have multiple swf's open you can communicate between them and do it that way lol (Assuming that if in a browser, the browser didn't run each swf in a single thread itself)

My social worker says im special!

BBS Signature

None

Glaiel-Gamer

Reply To Post Reply & Quote

Posted at: 9/25/09 05:14 AM

Glaiel-Gamer NEUTRAL LEVEL 27

Sign-Up: 12/28/04

Posts: 8,053

At 9/25/09 05:13 AM, dELtaluca wrote: Or as glaiel points out

in a private conversation off thread


None

hesselbom

Reply To Post Reply & Quote

Posted at: 9/25/09 08:31 AM

hesselbom NEUTRAL LEVEL 01

Sign-Up: 07/19/08

Posts: 304

One simple way to kind of simulate threads is to do smaller chunks of the operatons in a timer. For example, instead of looping 10,000 times at once, loop 100 times in each timer iteration.

Ultimately, it will take longer time to loop through all those 10,000 objects but because it will not try to do it all at once you save some performance.

I have used this technique for large loops in flash and it has worked fine for me so far.


None

henke37

Reply To Post Reply & Quote

Posted at: 9/25/09 03:46 PM

henke37 NEUTRAL LEVEL 23

Sign-Up: 09/10/04

Posts: 3,592

And with some smart logic, you can push the loop length to just as much as flash can take without dropping any frames.

Each time someone abuses hittest, God kills a kitten. Please, learn real collision testing.


None

GustTheASGuy

Reply To Post Reply & Quote

Posted at: 9/25/09 04:00 PM

GustTheASGuy LIGHT LEVEL 08

Sign-Up: 11/02/05

Posts: 11,380

Using a tiny timer automatically maxes the execution.

#ngprogramming at irc.freenode.net
haXe | Keel imperative | Spyro! | Thru you


None

henke37

Reply To Post Reply & Quote

Posted at: 9/26/09 05:03 AM

henke37 NEUTRAL LEVEL 23

Sign-Up: 09/10/04

Posts: 3,592

Actually, not only does that waste cpu time with the function call stuff, it does have a max rate. I read that timers only fires up to ten times per rendered frame.

Each time someone abuses hittest, God kills a kitten. Please, learn real collision testing.


None

Jon-86

Reply To Post Reply & Quote

Posted at: 9/26/09 03:44 PM

Jon-86 NEUTRAL LEVEL 13

Sign-Up: 01/30/07

Posts: 3,890

It would probaly be a pain in the arse having multiple SWFs on the go at the same time, sounds live a viable solution mind you but not right for what I'm doing.

Cheers anyway for the good suggestions & ideas!

PHP Main :: C++ Main :: Java Main :: irc.freenode.net

BBS Signature

The-Super-Flash-Bros LIGHT LEVEL 27

Sign-Up: 09/02/02

Posts: 1,247

The state machine that alchemy compiles to can simulate basic threading written in C++, but it's pretty much an actionscript implementation, so there isn't a performance benefit. It was added to let you re-write less of you c++ source.

So not too helpful, but it's there

Tom-


All times are Eastern Standard Time (GMT -5) | Current Time: 09:18 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!