.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
The Star and the Crescent- Save $9.00

   







Go Back   .com.unity Forums > Shrapnel Community > Space Empires: IV & V

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #22  
Old September 23rd, 2007, 10:02 PM
Will's Avatar

Will Will is offline
Lieutenant Colonel
 
Join Date: Mar 2001
Location: Emeryville, CA
Posts: 1,412
Thanks: 0
Thanked 0 Times in 0 Posts
Will is on a distinguished road
Default Re: OT: Building a new computer...

It would not actually be too much of a problem structure-wise to get most games multi-threaded. For example, SEV; instead of each AI processing its turn in order, just spawn a thread for each AI, and have each work on its processing at the same time. For combat, spawn a new thread to resolve the combat, and continue processing other parts of the game.

The issue isn't with games not having multiple threads in mind at the design stage; the issue is with actually writing the games to exploit multiple threads WITHOUT concurrency bugs. A FPS-type game is fairly natural with two threads, one to update the game state (player input, monster movements, etc), and the other to read the game state and do the appropriate rendering on the screen. This avoids the issue of concurrency bugs because it doesn't really matter much if the renderer reads part of the game state before or after an update, since it will just render all over again in a few milliseconds. The combination of read-only and rapid looping means that programmers can use two threads with no trouble. However, when there are multiple threads that are reading AND writing state, there become issues. They are issues that in principle are solvable (TSL, semaphores, monitors), but do not always amount to performance gains. Making code multi-threaded will ALWAYS add overhead to the process, and often that overhead will exceed the gains from having multiple execution units. And since some things will always need to be processed serially instead of in parallel, there is a limit to what multiple cores can accomplish. That's why the most performance gains you will usually see from doubling processing cores is 50%, and sometimes you will see performance hits. That's why it is not worth shelling out cash for a quad core in the current environment.
__________________
GEEK CODE V.3.12: GCS/E d-- s: a-- C++ US+ P+ L++ E--- W+++ N+ !o? K- w-- !O M++ V? PS+ PE Y+ PGP t- 5++ X R !tv-- b+++ DI++ D+ G+ e+++ h !r*-- y?
SE4 CODE: A-- Se+++* GdY $?/++ Fr! C++* Css Sf Ai Au- M+ MpN S Ss- RV Pw- Fq-- Nd Rp+ G- Mm++ Bb@ Tcp- L+
Reply With Quote
 

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 07:17 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.