[fpc-pascal] D-Bus. Non blocking listening for signals

dibo20 at wp.pl dibo20 at wp.pl
Thu Jan 13 13:24:33 CET 2011


W dniu 10.01.2011 20:41, Michael Van Canneyt pisze:
>
>
> On Mon, 10 Jan 2011, dibo20 at wp.pl wrote:
>
>> Sorry for refreshing, but the problem is still present :( . It works 
>> perfect on my mashine (ubuntu 10.10 64 bit) but doesn't work on my 
>> friends computer. For example, one of my friend have this same laptop 
>> as me and exactly this same version of ubuntu (64 bit too). My 
>> application find signals only when he moving mouse cursor over main 
>> form (on idle event is fired in which I check for signals too). It 
>> looks like method dbus_connection_set_wakeup_main_function doesn't 
>> register wake up function properly. This is procedure, not function 
>> so I don't even know if there was error.
>
> That can of course be, but this is not under our control.
>
>> I copy source of my program to ubuntu 10.10 32bit on my virtual 
>> mashine and compile on latest SVN version of lazarus (like on 64 bit 
>> ubuntu). This same problem. I debug this and wake up function is 
>> never called in client when dbus host send signals. I have no idea 
>> why on 64 bit (and only on my) it works ok. Some external library is 
>> responsible for this? All computers are upgraded to latest version, 
>> so we have this same dbus library.
>
> Do they run the same desktop ?
>
> Can you please provide testprograms (client and server) so I can run 
> some tests ?
>
> Michael.
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
Did you receive my mailwith demo? I think I found temporary solution. In 
glib2 is procedure: g_main_context_set_poll_func(g_main_context_default, 
@CheckForSignalProc);

It seems that application main loop call registered CheckForSignalProc 
on each loop cycle without blocking user interface and it works. But I 
do not know if I understand the documentation:

"Sets the function to use to handle polling of file descriptors. It will 
be used instead of the |poll()| system call (or GLib's replacement 
function, which is used where |poll()| isn't available).

This function could possibly be used to integrate the GLib event loop 
with an external event loop."

"integrate the GLib event loop with an external event loop" - I think 
this is what I want.

My concerns:
1. How does it affect to performance? Is it too often calledfor dbus?
2. Glib is most used by GTK. Will this work when I compile project with 
QT interface for KDE? (my future plans). I do not want to force users to 
install whole GTK librarys when they areusing only QT

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20110113/de1a395d/attachment.html>


More information about the fpc-pascal mailing list