Threaded PC Engine

After a misadventure into making my Android game engine threaded for higher performance, (A two threaded app on a single core phone was destined to fail!), I decided to do the same on PC, where multi-core processors are the norm nowadays.

There are two threads: a renderer and a worker. The worker does all the calculations for the next frame, and the renderer draws all the game objects to the window. The worker starts the renderer at the same time as it starts itself, then waits for the renderer to complete before starting the cycle again.

On Android with a single core, the switching between threads contained so much overhead that the performance suffered greatly. However, on PC, it still seems to be good, at least for a simple scene. I’ll see how things pan out as the scene gets more complicated.

Here is a screenshot, with the worker thread limited to 65 FPS, for good measure.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: