Re: gdk_threads_leave in gtk callback ?

2006-04-09 Thread Vladimir
Hello, My program was already written using single thread and approach you described (using g_idle_add and poll). One of the functions of the program is audio transmission (to and from network-connected hardware device using special protocol), and it is required to receive and send packets with sp

Re: gdk_threads_leave in gtk callback ?

2006-04-03 Thread Tristan Van Berkom
Gus Koppel wrote: [...] BTW, can I use g_idle_add in non-main thread without locking ? I am not sure. The documentation is not clear about this and I havn't had the time to examine the sources of that yet. To be safe, you should wrap a simple GStaticMutex lock around the call. g_idle_add() i

Re: gdk_threads_leave in gtk callback ?

2006-03-31 Thread Gus Koppel
Gus Koppel wrote: > Vladimir wrote: > > > There are two uses of GTK+ in non-main threads: > > 1. error reporting via message boxes and > > 2. adding text (which comes from network) to GUI windows. > > Btw, if you don't use modal message box dialogs then there is absolutely > no need to use mult

Re: gdk_threads_leave in gtk callback ?

2006-03-31 Thread Gus Koppel
Vladimir wrote: > There are two uses of GTK+ in non-main threads: > 1. error reporting via message boxes and > 2. adding text (which comes from network) to GUI windows. Btw, if you don't use modal message box dialogs then there is absolutely no need to use multiple threads (aka one to receive, t

Re: gdk_threads_leave in gtk callback ?

2006-03-31 Thread Gus Koppel
Vladimir wrote: > Gus Koppel wrote: > > > There shouldn't be any additional buffer copying required just because > > dealing with it moves from one thread to another. You know, all threads > > have the same access to all program data. > > Yes, but in my case buffers are reused to recv next packe

Re: gdk_threads_leave in gtk callback ?

2006-03-31 Thread Vladimir
Gus Koppel wrote: > There shouldn't be any additional buffer copying required just because > dealing with it moves from one thread to another. You know, all threads > have the same access to all program data. Yes, but in my case buffers are reused to recv next packets from network, so copying (or

Re: gdk_threads_leave in gtk callback ?

2006-03-31 Thread Gus Koppel
Vladimir wrote: > Thanks a lot for comprehensive explanations. > > There are two uses of GTK+ in non-main threads: > 1. error reporting via message boxes and > 2. adding text (which comes from network) to GUI windows. > > I can do both of it in main thread but this involves copying text to > dy

Re: gdk_threads_leave in gtk callback ?

2006-03-31 Thread Vladimir
Thanks a lot for comprehensive explanations. There are two uses of GTK+ in non-main threads: 1. error reporting via message boxes and 2. adding text (which comes from network) to GUI windows. I can do both of it in main thread but this involves copying text to dynamically allocated buffers. BTW

Re: gdk_threads_leave in gtk callback ?

2006-03-30 Thread Gus Koppel
Vladimir wrote: > I'm writing program with several threads each of which uses gtk. > I need to wait for one of the threads in gtk-generated callback. I can't do > it directly because of gdk lock. So the question is: can I temporarily > release gdk lock in gtk-generated callback ? Will it cause any

gdk_threads_leave in gtk callback ?

2006-03-30 Thread Vladimir
Hello, I'm writing program with several threads each of which uses gtk. I need to wait for one of the threads in gtk-generated callback. I can't do it directly because of gdk lock. So the question is: can I temporarily release gdk lock in gtk-generated callback ? Will it cause any problems ? --