View Full Version : Multithreading
Dr.Sid
04-09-2008, 06:10 PM
Today I've built simple thread manager, I hope I'll redo terrain loading to multi-threading tomorrow :cool:
Zachstar
04-10-2008, 08:35 PM
Isn't multi threading the first thing that is done in an application?
Dr.Sid
04-11-2008, 06:15 AM
Not really. While it complicates things it does not change much of the code. All what I did now was to shade windows threading model so it will be simple to port this. There is also not much reasons for threads at all. Now I'd like to use it for asynchronous file reading and processing, which most games does not do at all, since usually all is loaded at the beginning. I'm still not decided if rendering should be different thread for simulation. While it can be more effective of multi core CPU (I guess) it brings lots if synchronization problems. Still there would be practically no change in the actual code if I decide to do so.
On the other hand what I do now still are the 'first things' :biggrin:
OneShot
04-11-2008, 10:36 AM
Considering that Multicore processors are around more and more I support the idea of threading. Furthermore, somewhen down the road it might be helpful to have threads for various topics like physics, AI, rendering and more. It would be a nice change to actually have a sim who really uses the new capabilities in computer technology.
Dr.Sid
04-11-2008, 11:07 AM
Well the problem is that this brings a lot of complications, and needed synchronization, so in some cases multithreading can actually be slower, and it also makes debugging much more complicated. Especially the idea of 'thread for everything' is not much used just because the additional control mechanisms cancels its effect.
It's not much used just because it has not clear advantages. Anyway DW uses like 20 threads. I wonder if it uses threads for individual platform's AI, on the other hand the design of the scripts point to singlethreaded AI.
I'm doing some research, it seems that multithreading (not multiprocessing) can't use multi core CPUs anyway (at least on my dual CPU all threads of a process are always on one core).
Zachstar
04-24-2008, 02:53 PM
Last time I checked you had to put code in to spread the work to other cores.
And I may be 100 percent wrong but by the time you want to do that you mise well design it with 64 bit in mind. And only MAJOR projects need the power of 64 bit.
Dr.Sid
04-24-2008, 04:08 PM
I still could not find the good job for the other cores. But now I've found it !
In DW the CPU is under pressure especially in singleplayer with time compression. You mostly do physics and AI, but you must do it much more often. This is where both (or more) cores could be used.
Otherwise there is little options. The game must run on older single core and must do all the needed things. It can use simpler graphics, but hardly simpler game mechanisms.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.