• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Games single threaded? Not BF2.

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
I have read a number of comments to the effect that games aren't written to take advantage of multiple cores. The thought seems to be that games are all single threaded, and so the extra core doesn't help. But what these people forget is that even if the game is single threaded, it is using pieces of the operating system that create threads. Anyway, I decided to check BF2s thread count. I loaded up the game, joined a multiplayer server, then alt-tabbed out to check the threadcount in Task Manager.

BF2 after joining a multiplayer server has 11 threads running.

I don't have many other games installed. If anyone else can check and post results here it would be interesting to see how many threads other popular games have running.

Threadcount is not displayed in the processes tab of Task Manager by default. In the processes tab click View, then Select Columns. In that dialog click the checkbox next to threadcount in the righthand column.
 
It's single threaded in that it only uses 100% of one core- or it may actually use 50% on both cores. Click on the performance tab and check the graphs right after playing a game. You will see that both cores weren't operating at max. If it made full use of both cores, it would be considered multi-threaded. The threads shown in the task manager aren't really the same thing.
 
>> If it made full use of both cores, it would be considered multi-threaded.

I don't really agree with that. Whether or not the program is multi-threaded has nothing to do with the relative percentage of available CPU cycles that the threads are consuming. The bottom line is that multiple threads on one core require context switches to timeslice. If you can move threads to an additional core they can run side by side without context switches. If you can do this efficiently then the two (or more) cores running together will be able to distribute peak demand for CPU cycles more efficiently. Unless, as DaveSimmons pointed out in another post, all the real work is being done in one thread, and the others are suspended on events or whatever. Still you will get some advantage from the reduction in context switches to run all the threads the game creates.
 
Most games actually are multithreaded now, it's just that it's usually 1 thread per task (for example sound), and a lot of those tasks use very little CPU. This lets a dual-core system do some work in parallel, as well as placing the OS's own threads on the other core.

Spawning 1 thread per task is fairly easy, what is much harder (so not done much yet) is splitting a single task like rendering or AI into multiple threads sharing the work. Sharing requires figuring out how to divide the work evenly and to do so without causing problems from 2 threads trying to change the same set of data.

For example in a RTS deciding to move a set of units, the AI would look at the map and plan out each unit based on what it decided for all of the other units. Having 2 threads each making the decisions for one half of the units gets tricky to coordinate with the decisions made for the other half.

You need that kind of splitting up of the hard tasks before you'll see much gain from dual-core
 
Yes, you're really talking about parallel processing chunks of the same task, which is a trickier subject to be sure.
 
Back
Top