In our OpenGL ES game we have a loading screen (static image) drawn from the main thread at 60 fps and a background loading thread (a pthread actually created with default settings, no priority attributes applied).
Tests show that loading PNG images (involves CPU-heavy zip decompression) from the main thread is 3-times faster than loading them in backgroud thread.
To exclude IO operations and synchronization I have written a simple test. Code like this:
static volatile double outputSlot = 0.0; // volatile to avoid optimizations.
for (int i = 0; i < 1000000; ++i)
outputSlot = sin(i);
And this code executes 2-times faster on the main thread than on a background thread. Instruments do not reveal any anomalies.
Is it true that the main thread has a real-time priority and is more privileged?