How to avoid client side polling?

Fan Wu wufan9418 at gmail.com
Sun Jul 29 08:39:49 PDT 2007


Hi Thiago,

>Yes, there is. Have it select as well on a pipe, onto which you can write
>to make the loop wake up. We use that technique in Qt.

Could you please show me a link to the Qt code that does this?

> You want to have a select-based event loop in your application and just
> plug the DBusConnection socket descriptor into it. Like I described in
> the previous email.

Are you suggesting writing a mainloop which polls the file descriptor
of DBusConnection, as well as a pipe specifically added to wake up the
select sleep?

Thanks!
Fan



On 7/29/07, Thiago Macieira <thiago at kde.org> wrote:
> Fan Wu wrote:
> >/**
> >* @todo We need to have a way to wake up the select sleep if
> >* a new iteration request comes in with a flag (read/write) that
> >* we're not currently serving. Otherwise a call that just reads
> >* could block a write call forever (if there are no incoming
> >* messages).
> >*/
> >
> >So I guess at this time there is no off-the-shelf way to interrupt a
> >select sleep.
>
>
> >Comments?
>

>
> --
>  Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>   PGP/GPG: 0x6EF45358; fingerprint:
>   E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
>
>


More information about the dbus mailing list