Mandelbrot Shader: Holy Effing Crap!

Absolute times to calculate a fixed range of the Mandelbrot set:

Machine Concurrency Language Time
Dual-Opteron Singlethreaded C# ~0.81
Dual-Opteron Multithreaded C# ~0.45
Dual-Opteron Singlethreaded C++ ~0.50
Dual-Opteron Multithreaded C++ ~0.38
XBox 360 Singlethreaded C# ~4.4
XBox 360 Multithreaded C# ~2.1
XBox 360
GPU Shader

This isn’t even fair because the non-GPU timings are strictly timings of the calculation loop. The GPU timing is actually derived from my frame-rate.

I’m having some trouble getting my shader to run on my desktop (ATI All-In-Wonder with Radeon X800), but will post that number when I can.

XNA Multithreading: Must Set Processor Affinity Manually

Ah, that’s more like it. This is a graph of duration (in seconds) versus the number of threads during a calculation of a Mandelbrot set using the XNA Framework on the XBox 360 (Neil: The previous graph was normalized speed, as you suspected. For more on labeling the Axis in Office 12, see the next post.)

In order to have the XNA Framework distribute processing, you must explicitly set the “thread affinity.” This must be done within the worker thread (presumably early in the ThreadStart delegate) and, on the XBox 360, you must not use the values 0 or 2, which are reserved. Thus, I use code like this:


struct ThreadWorker
    int processorAffinity;
    static int processorAffinityIterator = 0;
    internal ThreadWorker()
        switch (processorAffinityIterator)
            case 0  :
                processorAffinity = 1;
            case 1 :
                processorAffinity = 3;
            case 2 :
                processorAffinity = 4;
            case 3 :
                processorAffinity = 5;
            default :
                processorAffinity = 1;
        if (++processorAffinityIterator == 4) { processorAffinityIterator = 0; }
   internal void ThreadRun()
   ... begin work ...

Office 12 Excel Graphing Bug: Axis Label Not Copied On Cut-And-Paste

Properly chastised by Neil Bartlett for not labeling my Y Axis on a graph, I added such a title to my next attempt. I then cut-and-pasted that image, which resulted in this being pasted into my blog editor:



And yet, I had already typed the Axis Title, as this screen capture of my Excel chart shows:

Now if only I could also figure out how to add a title for the X axis! Thank God for the Ribbonbar!