RE: deadlock



If reading and processing the incomming data takes so long or is so time
sensitive that it needs to be done in a thread, how about reading and
processing all the data ready for display first.  When you've got the
numbers and texts to poke into the neccesary places, notify the GUI that
new data is ready using g_idle_add().  A callback within the GUI thread
can then take that data, shove it into the appropriate places, and
continue on with barely a twitch.
that's also my problem...
i'm developing a gtk+ based equivalent to 'netstat' and 'sockstat'.
my app creates a thread, who executes every second a function to refresh
the GtkTreeView.
but when lots of add's and remove's perform (or i detach and re-attache
the model of the view), then some signal handlers have invalid data to
provide and a segmentation fault appear.
i'm evaluate, to change my code to satisfy gtk with g_idle_add,
g_source_new, g_source_attach and related functions, so the signal,
thread und gui stuff is well controlled.
can you make examples, when these functions appear?

greets

Andreas Bachmann

Program received signal SIGSEGV, Segmentation fault.
0xfea6ac34 in g_str_hash () from /opt/csw/lib/sparcv8/libglib-2.0.so.0
(gdb) backtrace
#0  0xfea6ac34 in g_str_hash () from /opt/csw/lib/sparcv8/libglib-2.0.so.0
#1  0xfea2d108 in g_hash_table_lookup () from
/opt/csw/lib/sparcv8/libglib-2.0.so.0
#2  0xfea226e4 in g_quark_from_string () from
/opt/csw/lib/sparcv8/libglib-2.0.so.0
#3  0xfeb25b3c in g_object_dispatch_properties_changed () from
/opt/csw/lib/sparcv8/libgobject-2.0.so.0
#4  0xfeb26974 in g_object_thaw_notify () from
/opt/csw/lib/sparcv8/libgobject-2.0.so.0
#5  0xfef790b4 in gtk_tree_view_column_cell_set_cell_data () from
/opt/csw/lib/sparcv8/libgtk-x11-2.0.so.0
#6  0xfef53ffc in gtk_tree_view_bin_expose () from
/opt/csw/lib/sparcv8/libgtk-x11-2.0.so.0
#7  0xfef54ac0 in gtk_tree_view_expose () from
/opt/csw/lib/sparcv8/libgtk-x11-2.0.so.0
#8  0xfedeed2c in _gtk_marshal_BOOLEAN__BOXED () from
/opt/csw/lib/sparcv8/libgtk-x11-2.0.so.0
#9  0xfeb221a0 in g_closure_invoke () from
/opt/csw/lib/sparcv8/libgobject-2.0.so.0
#10 0xfeb43bdc in signal_emit_unlocked_R () from
/opt/csw/lib/sparcv8/libgobject-2.0.so.0
#11 0xfeb4288c in g_signal_emit_valist () from
/opt/csw/lib/sparcv8/libgobject-2.0.so.0
#12 0xfeb42b94 in g_signal_emit () from
/opt/csw/lib/sparcv8/libgobject-2.0.so.0
#13 0xfef965f4 in gtk_widget_event_internal () from
/opt/csw/lib/sparcv8/libgtk-x11-2.0.so.0
#14 0xfedeb9bc in gtk_main_do_event () from
/opt/csw/lib/sparcv8/libgtk-x11-2.0.so.0
#15 0xff248170 in gdk_window_process_updates () from
/opt/csw/lib/sparcv8/libgdk-x11-2.0.so.0
#16 0xfef6b0c8 in gtk_tree_view_real_set_cursor () from
/opt/csw/lib/sparcv8/libgtk-x11-2.0.so.0
#17 0xfef500c0 in gtk_tree_view_button_press () from
/opt/csw/lib/sparcv8/libgtk-x11-2.0.so.0
#18 0xfedeed2c in _gtk_marshal_BOOLEAN__BOXED () from
/opt/csw/lib/sparcv8/libgtk-x11-2.0.so.0
#19 0xfeb221a0 in g_closure_invoke () from
/opt/csw/lib/sparcv8/libgobject-2.0.so.0
#20 0xfeb43bdc in signal_emit_unlocked_R () from
/opt/csw/lib/sparcv8/libgobject-2.0.so.0
#21 0xfeb4288c in g_signal_emit_valist () from
/opt/csw/lib/sparcv8/libgobject-2.0.so.0
#22 0xfeb42b94 in g_signal_emit () from
/opt/csw/lib/sparcv8/libgobject-2.0.so.0
#23 0xfef965f4 in gtk_widget_event_internal () from
/opt/csw/lib/sparcv8/libgtk-x11-2.0.so.0
#24 0xfeded134 in gtk_propagate_event () from
/opt/csw/lib/sparcv8/libgtk-x11-2.0.so.0
#25 0xfedeba00 in gtk_main_do_event () from
/opt/csw/lib/sparcv8/libgtk-x11-2.0.so.0
#26 0xff266ea4 in gdk_event_dispatch () from
/opt/csw/lib/sparcv8/libgdk-x11-2.0.so.0
#27 0xfea40128 in g_main_dispatch () from
/opt/csw/lib/sparcv8/libglib-2.0.so.0
#28 0xfea426d0 in g_main_context_iterate () from
/opt/csw/lib/sparcv8/libglib-2.0.so.0
#29 0xfea43448 in g_main_loop_run () from
/opt/csw/lib/sparcv8/libglib-2.0.so.0
#30 0xfedea6c0 in gtk_main () from /opt/csw/lib/sparcv8/libgtk-x11-2.0.so.0
#31 0x00011b58 in main (argc=1, argv=0xffbef86c) at TCPViewMain.c:13







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]