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.

In reply to Re^8: Threads + OpenGL act weirdly? by Xenofur
in thread Threads + OpenGL act weirdly? by Xenofur

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.