On Mon, 14 Sep 2009 18:02:25 -0400 (EDT)
Marshall Lake ml...@mlake.net wrote:
I'll be a son-of-a-gun. Removing the gdk_* calls fixed the problem.
It's something I should have known.
The GDK global lock is difficult to use correctly. All GTK+ signal
callbacks are entered holding the lock (as
On Sun, 13 Sep 2009 18:35:06 -0400 (EDT)
Marshall Lake ml...@mlake.net wrote:
I've taken some time to check the mutex and locks/unlocks between the
secondary thread and the idle function. All appear as it should.
The locks/unlocks are being applied in an orderly fashion and as they
should
On Mon, 14 Sep 2009 13:24:30 -0400 (EDT)
Marshall Lake ml...@mlake.net wrote:
I'm using only Linux.
I assume you have made the main loop thread-safe by calling
g_thread_init()?
The following are the first few lines of my main() ...
openlog (gtknsbclient, LOG_NDELAY, LOG_USER);
The following are the first few lines of my main() ...
openlog (gtknsbclient, LOG_NDELAY, LOG_USER);
if (!g_thread_supported ())
g_thread_init (NULL);
gdk_threads_init ();
gdk_threads_enter ();
/* initialize GTK interface */
gtk_init (argc, argv);
And
On Sat, 12 Sep 2009 17:46:17 -0400 (EDT)
Marshall Lake ml...@mlake.net wrote:
The important point in looking at out-of-order locking (or other
locking issues) is that the idle handler runs in the thread in
which the main program loop runs, not the thread which called
g_idle_add()/
The important point in looking at out-of-order locking (or other
locking issues) is that the idle handler runs in the thread in which
the main program loop runs, not the thread which called
g_idle_add()/ g_idle_add_full(), and that it runs at a time not of
that calling thread's choosing.
On Sat, 12 Sep 2009 00:18:59 -0400 (EDT)
Marshall Lake ml...@mlake.net wrote:
[snip]
I can't find a non-commercial deadlock checker for Linux. I agree
that the multi-threaded facet of the code is causing my problem but
so far I'm having trouble using breakpoints/debug code to isolate the
The mutex locks/unlocks are only in a secondary thread and an idle
function. I assume there's no problems with idle functions using
mutexes?
There is no problem provided that any mutex acquired by the idle
function does not block (it immediately acquires), or if it does block
then it only
On Sat, 12 Sep 2009 12:00:11 -0400 (EDT)
Marshall Lake ml...@mlake.net wrote:
[...]
Me:
The important point in looking at out-of-order locking (or other
locking issues) is that the idle handler runs in the thread in
which the main program loop runs, not the thread which called
Then you must have some function blocking between your call to
g_idle_add_full() and control returning to the main loop.
Anything in a GTK+ signal or event handler must not block. This means
in practice that nothing should block after your call to gtk_main().
After spending more time with
On Wed, 9 Sep 2009 12:23:07 -0400 (EDT)
Marshall Lake ml...@mlake.net wrote:
I tried G_PRIORITY_HIGH_IDLE with similar results ... the idle
function is called only with the following code:
g_idle_add_full (G_PRIORITY_HIGH_IDLE, (GSourceFunc)
idlefunc, NULL, NULL); while
I tried G_PRIORITY_HIGH_IDLE with similar results ... the idle
function is called only with the following code:
g_idle_add_full (G_PRIORITY_HIGH_IDLE, (GSourceFunc) idlefunc, NULL, NULL);
while (gtk_events_pending ())
gtk_main_iteration ();
If the while loop is not part of
On Sat, 5 Sep 2009 17:39:33 -0400 (EDT)
Marshall Lake ml...@mlake.net wrote:
I tried G_PRIORITY_HIGH_IDLE with similar results ... the idle
function is called only with the following code:
g_idle_add_full (G_PRIORITY_HIGH_IDLE, (GSourceFunc) idlefunc,
NULL, NULL); while
On Fri, 4 Sep 2009 23:12:24 -0400 (EDT)
Marshall Lake ml...@mlake.net wrote:
What stops an idle function from being executed? ... pending events,
right?
I have a situation where an idle function does NOT get called with
the following code:
g_idle_add ((GSourceFunc) idlefunc, NULL);
What stops an idle function from being executed? ... pending events,
right?
I have a situation where an idle function does NOT get called with the
following code:
g_idle_add ((GSourceFunc) idlefunc, NULL);
OR
while (gtk_events_pending ())
gtk_main_iteration ();
On 09/04/2009 08:12 PM, Marshall Lake wrote:
What stops an idle function from being executed? ... pending events, right?
I have a situation where an idle function does NOT get called with the
following code:
g_idle_add ((GSourceFunc) idlefunc, NULL);
Well, that works fine for me,
16 matches
Mail list logo