Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Asynchronous Function

Author
Message
Rocco Sette
7
Years of Service
User Offline
Joined: 2nd Aug 2017
Location:
Posted: 26th Nov 2018 13:00
Hi,

How to launch an asynchronous function and test if the function is finished ?

Thank's
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 29th Nov 2018 00:05
If you mean recursion here is an example that draws a fractal tree



copied from my thread https://forum.thegamecreators.com/thread/222027
fubar
Ortu
DBPro Master
17
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 29th Nov 2018 01:11
Agk doesn't really have asynchronous processing. I think best you can do is set up your function to do only a small part of the total process each time and call it each main loop until finished
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Jack
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 29th Nov 2018 12:19 Edited at: 29th Nov 2018 18:40
Own Script Parser to do one command per loop. With a lot of parameter fun
Or you write a plugin in c# or c++ with a secondary thread, but beware that AGKT2 commands are not thread save. This is a good idea for hardcore math or network, if you do not want to slow rendering down.

[/url]
MillaSays
6
Years of Service
User Offline
Joined: 15th Dec 2017
Location:
Posted: 30th Nov 2018 09:39
Some stuff are done concurrently in the background, with little to no worry for us users on how it is done. Like bits of the networking and multiplayer routines.

As for user-controlled concurrency - in AppGameKit - no. There is no C# style async/await or Go style Go routines w. waitgroups and/or channels. Best you can do is ol'skool C style interleaved state machine structures. Iterating over several structures one piece at a time per loop.

Login to post a reply

Server time is: 2024-11-23 12:43:40
Your offset time is: 2024-11-23 12:43:40