title: What is advantage of using GMainLoop from glib.h rather than "while(true);" in C++ linux?
body: <p>I have come across a code where they needed an infinite loop &amp; they used </p>
  
  <pre><code>    GMainLoop *mainloop = NULL;
  
      mainloop = g_main_loop_new (NULL, FALSE);
      g_main_loop_run (mainloop);
  </code></pre>
  
  <p>I have doubt why don't they use <code>while(true);</code> for same purpose. What does GMainLoop internally do, Ain't it will be same internally. How does <code>GMainLoop</code>  enhances the performance.</p>