Jump to content

does 0 a.d. use Async/Await?


thankforpie
 Share

Recommended Posts

No all our code run synchronously. Node has a special engine in the background to process those commands. Recently they switched to V8 which is the same engine chrome uses. We use Spidermonkey which is used by firefox.  So it could be possible in theory, if we upgraded Spidermonkey to the latest version, but would need a complete rewrite of our codebase, with likely no benefit.

Link to comment
Share on other sites

3 minutes ago, stanislas69 said:

No all our code run synchronously. Node has a special engine in the background to process those commands. Recently they switched to V8 which is the same engine chrome uses. We use Spidermonkey which is used by firefox.  So it could be possible in theory, if we upgraded Spidermonkey to the latest version, but would need a complete rewrite of our codebase, with likely no benefit.

oh well thats bad, im using c# now, its faster than node, can make more, can be multithreaded and asynchronous, so i can have like few threads all of them being asynchronous

Link to comment
Share on other sites

The AI is not actually threaded, it is mostly async, to be easily threadable, but the latter needs to be done. Some other parts of the code (such as the pathfinder) are also properly designed to be threaded eventually, but they are not yet.

We need someone to implement the threading, we do not need yet to make more parts of the code asynchronous.

Link to comment
Share on other sites

21 hours ago, thankforpie said:

oh well thats bad, im using c# now, its faster than node, can make more, can be multithreaded and asynchronous, so i can have like few threads all of them being asynchronous

Multithreading isn't a silver bullet. It requires a lot of stuff: you need to synchronise different threads, you need to pass data between threads and you need code it without races. It costs a lot of time for complex projects, so as Stan said we may not have a visible benefit at all. Or its cost would be really huge.

So it should be analysed before introducing the multithreading in all stuff.

  • Like 1
  • Confused 1
Link to comment
Share on other sites

On 3/6/2019 at 9:18 PM, stanislas69 said:

No all our code run synchronously. Node has a special engine in the background to process those commands. Recently they switched to V8 which is the same engine chrome uses. We use Spidermonkey which is used by firefox.  So it could be possible in theory, if we upgraded Spidermonkey to the latest version, but would need a complete rewrite of our codebase, with likely no benefit.

 

Async await lets you perform I/O bound operations like talking with database or reading file from disk in the same time that it lets you perform mathematical calculations.

 

afaik 0 a.d. pathfinder consists of loads of heavy mathematical calculations right?

 

honestly i didnt manage to make use of it yet in my code because i dont perform any heavy mathematic methods in my projects, and when I do, i dont use anything I/O bound. I have to study about this mor,e maybe its more useful than I think

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...