View Single Post
  #24  
Old May 27th, 2008, 05:56 PM
Taqwus's Avatar

Taqwus Taqwus is offline
Major General
 
Join Date: Aug 2000
Location: Mountain View, CA
Posts: 2,162
Thanks: 2
Thanked 4 Times in 4 Posts
Taqwus is on a distinguished road
Default Unlikely.

1- Concurrency control is not something that should be grafted on after, if the code was not designed with it in mind.

There's much more to it than 'could this battle affect the outcome of another', for instance -- or how one seeds PRNG tables. There's also quite likely to be shared data structures (notably, the table of units -- and units get both created and destroyed in battle), for instance. There may be static variables that would need to become thread-local. And so forth.

Grafting on MT-ness is a serious pain. That's true even in languages which are designed for it, unlike ANSI C. It's even more true if you're using libraries, because you can't really assume that the people who coded the libraries made -their- code MT safe, or if they've provided sufficiently fine-grained locking to enable the serialization you need. Yeah, individual operations may be atomic... but if they didn't give you the methods to lock a sequence?

2- Dominions is unusually quite cross-platform. ANSI C does not specify any threading infrastructure, let alone a cross-platform one. Pthreads *might* serve, but the last release on Windows seems to be from 2006, so it wouldn't surprise me too much if it broke on more recent OSes.

Writing MT code for even one OS is enough of a pain.
__________________
Are we insane yet? Are we insane yet? Aiiieeeeee...
Reply With Quote