Re: GTK threads and socket operations

2014-11-26 Thread Mathieu Comandon
Hi! Speaking of threading in Gtk, I'm using it quite extensively in my application and never was really sure I was doing the right thing. Here are the part in my codebase where I handle background jobs and downloads: https://github.com/lutris/lutris/blob/master/lutris/util/jobs.py https://github.

Re: Re: GTK threads and socket operations

2014-11-26 Thread Emmanuele Bassi
hi; On 26 November 2014 at 10:27, Sergei Naumov wrote: > Is there any tutorial on them? I searched the Web and did not find any good > tutorial on GTK threads. the only tutorial needed is probably something like: Q: Can I use GTK API from different threads? A: No. if you have a long-runnin

RE: Re: GTK threads and socket operations

2014-11-26 Thread Sergei Naumov
Is there any tutorial on them? I searched the Web and did not find any good tutorial on GTK threads. -- Sergei O. Naumov 26.11.2014, 12:41:16 пользователь Bernhard Schuster (schuster.bernh...@gmail.com) написал: You modify your label from a thread that is not the main/ui thread. Gtk+ is no

Re: GTK threads and socket operations

2014-11-26 Thread Bernhard Schuster
You modify your label from a thread that is not the main/ui thread. Gtk+ is not threadsafe (few exceptions). Use g_idle_add/ g_timeout_add/ and friends (those are threadsafe) to implicitly serialize your ui modifications into the gtk mainloop. Do not use GDK_THREADS_ENTER/LEAVE foo unless you are