Jump to content

multithreading support


DGMurdockIII
 Share

Recommended Posts

  • 2 weeks later...

Multithreading could work well with AI (branching every, say, 16 actors off into their own thread), which is a bottleneck on bigger scenes, but it's very hard to retroactively integrate parallelization into a project born before multithreading became popular.

Maybe this will happen once the 0AD gets to 'feature-complete' and 'fully playable' stages, but for now I think most people are more interested in being able to play the game at all than play it fast (y)

Link to comment
Share on other sites

Yeah, the synchronisation overhead would probably defeat any of the performance benefits if we tried to do much multithreading with the current engine since there's too many dependencies between the code, and it would add a lot of complexity. There are architectures that can make it more feasible but it'd be very hard to switch to them.

There are some cases where we should add threading to improve latency (in the networking code), and some small areas where we possibly could use it to improve multi-core performance (like pathfinding, and maybe some graphics code (like skinning)), but it's probably more worthwhile spending time optimising single-core performance first.

Link to comment
Share on other sites

why couldn't you optimize both single-core and multi-core performance at the same time?

I can also see if you wanted to first make sure this you had multi-core performance it as much as you could for single-core performance before working on multi-core stuff

Link to comment
Share on other sites

why couldn't you optimize both single-core and multi-core performance at the same time?

As mentioned, it is basically impossible to retroactively optimize multi-core performance in a meaningful fashion, i.e. scaling properly on 8+ cores.

The usual way of managing that nowadays is splitting the simulation updates into microtasks and dispatching them to available cores. That (as with other huge change in requirements) entails a major redesign+rewrite, which is not in the cards right now ;)

Link to comment
Share on other sites

Infinitely parallelising simulation updates wouldn't help that much anyway - even in its current poorly-optimised state, most of the time is usually spent in other areas (mostly graphics, some GUI, etc). Probably most of the engine would have to be redesigned else it'd be bottlenecked by some serial code and wouldn't get much improvement.

But we should revisit this when we start our next engine and 8+ cores is the min spec ;)

Link to comment
Share on other sites

  • 3 months later...
  • 2 weeks later...

I have seen this same thing discussed over and over in the Dwarf Fortress forums. What it kind of amounts to is if you buy a new car that runs on Gasoline, then you decide later that you want a Diesel car, it would be prohibitively difficult to "Just Change It Over".

I have not looked at the current architecture, but I would think running the graffics on the GPU would be mostly do-able. In fact looking at the Screen Shots I am betting they already do this. Perhaps a little bit of Rough Multi-Core support may be possible, though probably not really easy.

But Multi-Core / Multi-Threaded is !!*_HARD_*!! Not just because they started single core, it really is non-trivial.

That all being said, boy I can hardly wait for this game to hit 1.0!!

Gary

Edited by diriel
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...