Thursday, March 5, 2015

KaAllocator / KaTask Refactor Cont

Now my hand works again I decided to do a little bit of coding tonight on my new allocator system.  Inspired by an old bitsquid blog post I decided to move to a full explicit allocator model, and reworked a ton of old subsystems ( like 2006 and older** ) to be more data-oriented as practice.  

Will soon be reworking the task management system to have easy dependencies.  Right now 'jobs' -- which are really tasks or jobs -- have to be explicitly enqueued or synced internal to their work unit.  This is because this code was written previous to modern task systems, which are now en vogue.  Instead it focused on specialized threads with process affinity and a collection of generic 'worker' threads.  Think render, game, io, general pool.  For example the screenshot 'job' would enqueue itself to the explicit renderthread to grab a framebuffer into memory -- HMD FBO, camera render target, or framebuffer -- then hop over to an encoder step and then finally explicit IO thread queue to dump out to disk / http.  What a pain.  Moving to a flatter generic system that can sit in a single ringbuffer is much easier to manage and debug.  A screenshot for systems code update blurb?  Sure why not!  Also cleaning up the embedded stats UI.  I want to put some of this on github at some point, so more people will think 'correctly' about this issue in the future.   :D

** The oldest source code had emacs mode lines, and was from the 90s.  :D