pioneerspacesim/pioneer — pull request #2879 by lwho (2014-04-21 16:52:21+00:00)
Title: Synchronous jobs

I recently tried to unify the caches for Sectors and StarSystems. It turned out, that StarSystem generation and multi-threading are like fire and water. Instead of diving deep into the stuff to find out, what exactly is so problematic in StarSystem generation, I decided to implement synchronous jobs, which is what the what this PR is about.

Synchronous jobs are executed by the main loop (currently one job in each mainloop iteration, but this is a tunable constant). The common ```JobQueue``` interface was extracted into an abstract base class. Our former multi-threaded ```JobQueue``` is now a subclass named ```AsyncJobQueue``` and the new synchronous one is another subclass named ```SyncJobQueue``` (you probably guessed so ;)). ```Pi``` has now two queue objects, one for synchronous and one for asynchronous jobs.

Synchronous jobs are currently unused, but I'll create a WIP PR of ```lwho/unified_cache``` in a moment, which uses synchronous jobs for prefilling the StarSystem cache in the same way as asynchronous jobs are used for the Sector cache.

@fluffyfreak: You're somewhat familiar with the Job code. So, could you please have a look (and a VS2013 compiler run ;))