GObject and signal queuing



I'm currently working on a multi-threaded program that uses GObject. The
GObjects I have created will be accessed from multiple threads. This
program also has a GTK+ front end. 

The problem I am currently trying to resolve is with updating the GUI to
match the state of the underlying GObjects. For performance reasons it
doesn't make sense to just attach signals from my GObjects to the GUI
update routines (plus the GTK thread would need to be locked). So I'm
trying to create a SignalQueue object that provides queuing of signals.
I have no trouble getting signals stored in a GList using GValueArrays
for signal parameters. What I'm having trouble with is figuring out how
to re-dispatch these signals, but not on the original objects (i.e. not
re-emitting the signals). 
It would be real nice to be able to have: 

app_signal_queue_connect (gpointer instance, const char
*detailed_signal, GCallback handler, gpointer data)

It seems I need to do a g_closure_invoke() on the class closure for a
particular signal ID and object instance. I see no public API for
getting the closure assigned to a particular signal though.

If anyone has any suggestions for better ways of doing this, existing
code dealing with this type of issue, suggestion of a more appropriate
mailing list to post this to, etc. Do let me know. Cheers.

    Josh Green




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