Re: Event loop hangup when using TimeoutSource and IdleSource
- From: Jim Hodapp <james hodapp gmail com>
- To: Chris Vine <chris cvine freeserve co uk>
- Cc: gtkmm-list gnome org
- Subject: Re: Event loop hangup when using TimeoutSource and IdleSource
- Date: Thu, 24 Sep 2009 17:02:00 -0400
Chris,
I am sure that the library does not touch GTK+ functions. It's a
C library and the only thing that touches the GUI is the GUI app
itself and that's only via C++ and gtkmm. The library does no output
other than to stderr. The library calls only get called one at a time.
The only thing that is *parallel* is the loop in the library that is
in a separate thread that calls select() to see if there's anything on
the serial port to read, and checks the message queues to see if any
commands need to go out to the device. I have the function that adds a
new command to the message queue protected with a mutex just in case I
ever have a GUI frontend that is multithreaded.
Thanks,
Jim
On Sep 24, 2009, at 4:54 PM, Chris Vine wrote:
On Thu, 24 Sep 2009 16:43:21 -0400
Jim Hodapp <james hodapp gmail com> wrote:
Chris,
I removed the inheritance statement from my Emsac class
definition and things seemed more stable. Things remained stable
until I moved the mouse over some widgets in the main window that
will accept focus and very shortly after that the application
segfaulted. The backtrace is as follows:
...
The GUI thread talks to the library thread directly through API
calls. I link the library into the GUI application and make direct
calls.
Are you sure that these "direct calls" are thread safe? Does the
library call any GTK+ functions through its API and if so in what
thread? Your report about your mouse is symptomatic of what happens
if
you try to address GTK+ from two different threads.
Chris
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]