Hi,<br><br>libnotify is a thin wrapper around D-BUS, and all communication happens within D-BUS. I don&#39;t have experience with libnotify and threads either (as I tend to avoid threads in my apps). It&#39;s possible that it&#39;s libnotify, but I would start off assuming the issue has to do with your app and D-BUS in some way.<br>
<br>Christian<br><br clear="all">-- <br>Christian Hammond - <a href="mailto:chipx86@chipx86.com">chipx86@chipx86.com</a><br>VMware, Inc.<br>
<br><br><div class="gmail_quote">On Thu, Feb 5, 2009 at 1:16 AM, Sundaram <span dir="ltr">&lt;<a href="mailto:legends2k@yahoo.com">legends2k@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div style="font-family: garamond,new york,times,serif; font-size: 14pt;"><div style="font-family: garamond,new york,times,serif; font-size: 14pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">
<div style="font-family: garamond,new york,times,serif; font-size: 14pt;"><div>Hi,<br>Is libnotify thread safe? Should I call dbus_g_thread_init() to make sure it is?<br><br>I have written a Eng. thesaurus <a rel="nofollow" href="http://sourceforge.net/projects/artha" target="_blank">Artha</a> using GLib &amp; GTK+, in which, when I get a particular hot key combination, on that key press signal handler, I call <span style="font-weight: bold;">notify_notification_show()</span> [before this, I close any earlier notifications by <span style="font-weight: bold;">notify_notification_close()</span>]. Everything works fine.<br>
<br>But, when I press that hot
 key combo more than a few times, say 10, for a first few I get notification after notification, but towards the end (arbitrary), the app. freezes and even the desktop freezes for a few seconds (8 to 10 secs) and then I see the notification and everything gets
 back to normal, including my app. But when this happens, <span style="font-weight: bold;">notify_notification_show()</span> returns a FALSE (eventhough a notification was shown), and GError msg reads thus: <i>&quot;Did
not receive a reply. Possible causes include: the remote application
did not send a reply, the message bus security policy blocked the
reply, the reply timeout expired, or the network connection was broken.&quot;.</i><br><i><br></i>As for the code, before calling any other func. I call <span style="font-weight: bold;">g_thread_init()</span>, then <span style="font-weight: bold;">dbus_g_thread_init</span> and <span style="font-weight: bold;">notify_init()</span> and then get a notifier handle by calling <span style="font-weight: bold;">notify_notification_new_with_status_icon()</span> with a GtkStatus icon, in my main, all of them only once. After that, when in gtk_main() loop, when ever I get a hot key press signal every time, I update the body &amp; summary of the same notifier with a new one using <span style="font-weight: bold;">notify_notification_update()</span> and then call notify_notification_show(). I haven&#39;t used any thread related functions except the above ones (init). Is anything wrong in this approach that libnotify&#39;s notify_notification_show() chokes the whole system for a few
 seconds, because of my wrong way of using it? Or is it a glitch on libnotify&#39;s side?<br><br>Thanks!<br><br>Regards,<br>Sundaram<br></div></div>

      </div></div></div><br>

      </div><br>_______________________________________________<br>
galago-devel mailing list<br>
<a href="mailto:galago-devel@lists.freedesktop.org">galago-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/galago-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/galago-devel</a><br>
<br></blockquote></div><br>