#4496: Use packaged task to submit A star executions
-------------------------------------------------+-------------------------
Reporter: Vincent | Owner:
Type: patch (an actual patch, not | Status: new
a request for one) | Milestone: unspecified
Priority: normal | Version: git/master
Component: Engine: Scripting / AI |
Operating System: All/Non-Specific |
-------------------------------------------------+-------------------------
This patch uses a packaged tasks to implement asynchronous A star
algorithm execution.
It makes code easier to read and reason about. Since packaged task embed
the task results
the secondary thread doesn't update std::list<PATHRESULT> object anymore
which remove
some extra mutex lock which should improve threads usage.
I tried to build using bash for Windows and mxe and it looks like it
works. Build complains
about undefined reference to WinMain but the packaged task include doesn't
throw any
errors. I guess packaged_task can be written using atomics which are
likely supported
everwhere (since it's a compiler builtin feature and not implemented by a
3rd party lib).
But additional tests are welcome.
--
Ticket URL: <http://developer.wz2100.net/ticket/4496>
Warzone 2100 Trac <http://developer.wz2100.net/>
The Warzone 2100 Project
------------------------------------------------------------------------------
_______________________________________________
Warzone2100-project mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/warzone2100-project