Re: [Dev-C++] Offtopic: Advice on GUI to learn
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Daniel K. O. <dan...@ya...> - 2004-01-16 06:42:37
|
Michael C Urban wrote: >If you use GTK though, be aware that most of its widgets are not thread >safe in MS Windows. (That's what I mean by buggy. They are thread safe in >Linux. But you can run into problems on Windows.) > > Actually, you just can't update the GUI from other threads. As Tor once said: [quote from http://mail.gnome.org/archives/gtk-devel-list/2001-November/msg00227.html ] I understand that in X11 the situation is different as the X server naturally knows nothing about threads in the client, so as long as the client (GTK+) itself knows what it is doing and uses appropriate locking, there shouldn't be any problems in operating on the same windows or other X11 objects from different threads (?). But Windows knows the thread that created each window, and some operations on a window from another thread might cause lots of fun like deadlocks unless the application programmer is very careful with what the window owning thread might be doing at the time another thread tries to operate on the window. [/quote] Also, a quote from Tristan: [quote from http://mail.gnome.org/archives/gtk-app-devel-list/2003-July/msg00015.html ] you can still write a multi-threaded application with _ONE_THREAD_THAT_UPDATES_THE_GUI_. [/quote] You just have to use g_idle_add to make the updates run inside the main thread. Daniel K. O. |