Re: Delay time to spawn new threads?

2013-11-28 Thread Osmo Antero
My audio-recorder that was based on GTK2 had some threads that also modified the GUI-elements. I had to call GDK_THREADS_ENTERhttps://developer.gnome.org/gdk3/3.10/gdk3-Threads.html#GDK-THREADS-ENTER:CAPS /

Re: Delay time to spawn new threads?

2013-11-28 Thread Chris Vine
On Thu, 28 Nov 2013 09:11:45 + Osmo Antero osm...@gmail.com wrote: My audio-recorder that was based on GTK2 had some threads that also modified the GUI-elements. I had to call GDK_THREADS_ENTERhttps://developer.gnome.org/gdk3/3.10/gdk3-Threads.html#GDK-THREADS-ENTER:CAPS /

Re: Delay time to spawn new threads?

2013-11-28 Thread Chris Vine
On Wed, 27 Nov 2013 19:32:26 -0800 (PST) David Buchan pdbuc...@yahoo.com wrote: I removed the call to g_thread_init() and it still works fine! Great catch there. You can include it with glib = 2.32 - it is a no-op then. You should include it if you want your code to be able to run on earlier

Re: Delay time to spawn new threads?

2013-11-28 Thread David Buchan
On Wed, 27 Nov 2013 19:32:26 -0800 (PST) David Buchan pdbuc...@yahoo.com wrote: I removed the call to g_thread_init() and it still works fine! Great catch there. You can include it with glib = 2.32 - it is a no-op then.  You should include it if you want your code to be able to run on earlier

Re: Delay time to spawn new threads?

2013-11-28 Thread Emmanuele Bassi
hi; On 28 November 2013 11:09, Chris Vine ch...@cvine.freeserve.co.uk wrote: By the way, why not have your idle function return FALSE instead of EXIT_SUCCESS? Both evaluate to 0, but returning FALSE is clearer. EXIT_SUCCESS is a macro intended to provide a process return value indicating

Re: Delay time to spawn new threads?

2013-11-28 Thread Chris Vine
On Thu, 28 Nov 2013 14:17:00 + Emmanuele Bassi eba...@gmail.com wrote: GSourceFunc functions should return G_SOURCE_CONTINUE or G_SOURCE_REMOVE; those are aliases for boolean values, but are much, much clearer to read. I suggest you put a bug in bugzilla. The documentation for the main

Re: Delay time to spawn new threads?

2013-11-27 Thread Andrew Potter
On Wed, Nov 27, 2013 at 7:29 AM, David Buchan pdbuc...@yahoo.com wrote: I have written a program which spawns a new thread when the user clicks a button. The new thread does something noticeable immediately after starting, so I know when the thread has begun. What I mean is, if I run that

Re: Delay time to spawn new threads?

2013-11-27 Thread David Buchan
1:24 PM Subject: Re: Delay time to spawn new threads? On Wed, Nov 27, 2013 at 7:29 AM, David Buchan pdbuc...@yahoo.com wrote: I have written a program which spawns a new thread when the user clicks a button. The new thread does something noticeable immediately after starting, so I know when

Re: Delay time to spawn new threads?

2013-11-27 Thread Michael Torrie
On 11/27/2013 08:29 AM, David Buchan wrote: I have written a program which spawns a new thread when the user clicks a button. The new thread does something noticeable immediately after starting, so I know when the thread has begun. What I mean is, if I run that piece of code that is executed

Re: Delay time to spawn new threads?

2013-11-27 Thread Andrew Potter
On Wed, Nov 27, 2013 at 11:20 AM, David Buchan pdbuc...@yahoo.com wrote: Yes, I've tried the printf thing. It takes about 1.5 sec. Very strange. It will be hard to help you much further without an example program. If thread creation does in fact take so long on your platform, you can perhaps

Re: Delay time to spawn new threads?

2013-11-27 Thread David Buchan
);   exit (EXIT_FAILURE);     } These threads do nothing with the GUI. Dave From: Michael Torrie torr...@gmail.com To: gtk-app-devel-list@gnome.org Sent: Wednesday, November 27, 2013 2:16 PM Subject: Re: Delay time to spawn new threads? On 11/27/2013 08

Re: Delay time to spawn new threads?

2013-11-27 Thread Michael Torrie
On 11/27/2013 12:59 PM, David Buchan wrote: Hi Michael, My 32-bit, GTK+2 version does // Secure glib if (!g_thread_supported ()) { g_thread_init (NULL); } at the beginning, and then the thread is spawned via: on_button1_clicked (GtkButton *button1, MyData *data) {

Re: Delay time to spawn new threads?

2013-11-27 Thread Chris Vine
On Wed, 27 Nov 2013 11:59:23 -0800 (PST) David Buchan pdbuc...@yahoo.com wrote: Hi Michael, My 32-bit, GTK+2 version does   // Secure glib   if (!g_thread_supported ()) {     g_thread_init (NULL);   } at the beginning, and then the thread is spawned via: on_button1_clicked

Re: Delay time to spawn new threads?

2013-11-27 Thread David Buchan
David Buchan pdbuc...@yahoo.com wrote: Hi Michael, My 32-bit, GTK+2 version does   // Secure glib   if (!g_thread_supported ()) {     g_thread_init (NULL);   } at the beginning, and then the thread is spawned via: on_button1_clicked (GtkButton *button1, MyData *data) {  

Re: Delay time to spawn new threads?

2013-11-27 Thread David Buchan
David Buchan pdbuc...@yahoo.com wrote: Hi Michael, My 32-bit, GTK+2 version does   // Secure glib   if (!g_thread_supported ()) {     g_thread_init (NULL);   } at the beginning, and then the thread is spawned via: on_button1_clicked (GtkButton *button1, MyData *data) {