What you write about is exactly what i encountered. Previously i didn't have an idle callback in the glut mainloop registered, and as such the program was only using cpu when it was actually doing something. However now i'm forced to have the idle callback go
cede(); all the time so the background synch loop doesn't stall. But i'm fine with that honestly, OpenGL applications normally run at full tilt at all times anyhow.
I'd LOVE to use proper threading, but i'm afraid i have no clue how to accomplish that when i'd need to share a three-dimensional as well as 2 four-dimensional arrays with the background thread as well.
As for the code, it is entirely public domain and hosted here:
http://code.google.com/p/dwarvis/
You can either grab /trunk/lifevis from the svn, or get a prepared package from here:
http://dwarvis.googlecode.com/svn/latest_downloads/lifevis.rar (Note that there are a bunch of files in the prog directory, like a flowchart .dia (out-dated and uncomplete, but still mostly relevant) and some other things.)
Also know that you will need to have the freeware game Dwarf Fortress (
http://bay12games.com/dwarves/) loaded with a world created, and a fortress embarked and open on your screen before lifevis will do anything useful.
Aside from that, i was thinking about posting in Meditations later on to see if i could get some advice on the overall thing, have people weigh in on what parts could be useful for others as CPAN modules, etc. As such, any and all comments are welcomed. :)
I should also note: I'm not always going the "proper" way in this. It is very much unfinished still and i don't want to burn myself out on learning overly complex modules and instead push on with implementation. So i may in the future and have already in the past ignore modules that might be useful, but come with either extremely complex usage patterns or documentation that assumes one already knows how the module works.