The Passage
Programming Title

April 29, 2011
Michael Schoell

Multithreading is like a hydra, you slay one head and out pops two more. The past week I have spent expanding my code so that my DirectX 9 device can work on Windows XP, because what is the use of writing DirectX9 code if all you support is Vista and Windows 7? However, XP does not support some synchronization functions that I used, those being any that relate to condition variables.

What I ended up with is a system that on initialization, checks if it is running on a XP or a new operating system. If it is XP, one system is used, if it is Windows Vista or 7, the original system is used. This is managed via function pointers to maximize speed and no continuous checks are required.

It took a number of various tests to confirm the new system, since it would not deadlock on my computer (in XP mode) but would on an older computer. More small issues may crop up as my engine becomes more advanced and the CPU and GPU load changes, but for now the hydra is slain.

However, at the same time I am not entirely happy with the way I accomplished the multithreading for XP. While in tests it seems to run about the same in XP and Windows 7 mode, the XP version spin locks in numerous places, waiting for variables to change.

Other work has been done on deferred shading. Currently, I only use it to do world lighting and only have setup the diffuse and the normal textures. Only one world light is currently possible, though that is part of my next tasks. Point lights will be added along with flexible world lighting possibilities. More on this once work has actually been done however.

Site Development and Design by <CS>

Graphic Design by Nathan Schoell