Re: Fwd: Segmentation fault on log



Is there a document that I can read about glib's thread safety? My
code gets called from different threads that I don't know about so I
protect some data with mutex but logging is not one of them (it's
costly to lock and unlock a mutex on every log message).

On 2/12/07, Robert Pearce <rob bdt-home demon co uk> wrote:
On Sun, 11 Feb 2007, José Antonio Sánchez <getaceres gmail com> wrote :
>Having diferent threads making logging could trigger this? or is it
>only triggered with g_debug("Somethig recursive: %s",rec(z)) where
>rec(z) is something that has a debug inside?

I'm not really a GTK expert, but my money would be on the former.

In the latter case, at least with your example, I don't believe that
would cause it. The reason being that it doesn't cause rec(z) to get
called _during_ the outer g_debug but rather _before_ it. The compiler
will evaluate all arguments of a function call before calling the
function with the results.
--
Rob Pearce                       http://www.bdt-home.demon.co.uk

The contents of this | Windows NT crashed.
message are purely   | I am the Blue Screen of Death.
my opinion. Don't    | No one hears your screams.
believe a word.      |
_______________________________________________
gtk-list mailing list
gtk-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-list



--
Saludos.
José Antonio Sánchez



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]