title: Safety of using pthreads in Gtk+2.0 application
body: <p>I have a simple multithreaded Gtk+2.0 application that acquires data from multiple sources (microphone, webcam, temperature sensor), and displays data from these as images on screen (webcam frame grabs, microphone data represented as oscilloscope renders, text, etc).</p>
  
  <p>It's to my understanding from the Gtk manual <a href="http://blogs.operationaldynamics.com/andrew/software/gnome-desktop/gtk-thread-awareness" rel="noreferrer">and various articles</a> that only the main processing thread should use any Gtk functions/calls that affect the UI. However, the <code>main()</code> entry point blocks on <code>gtk_main()</code> until I close the UI. With the exception of event handlers that are mapped to things like when I click on a button or slider in my UI, it seems the only option left open to me is to spawn a few <code>pthread</code>s and have them do the periodic sampling of data and updating information on-screen in the UI.</p>
  
  <p>I remember from doing some MFC GUI development a long ways back that a similar principle applied: only a single specific thread should be updating the UI elements. How do I accomplish this in C with Gtk+2.0?</p>
  
  <p>Thank you.</p>