<div dir="ltr"><br>2008/9/25 Havoc Pennington <span dir="ltr"><<a href="mailto:hp@pobox.com">hp@pobox.com</a>></span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<div class="Ih2E3d"><br>
</div>wakeup_main writes a byte to a pipe that the main loop is blocking on,<br>
to wake up the main loop thread from another thread. In theory it<br>
could probably be called at different times than dispatch status, I<br>
don't know if it in practice is right now or not, since the usual<br>
reason to wake up the main loop thread is that the main loop thread<br>
needs to dispatch. The dispatch status function is defined to be<br>
called when get_dispatch_status would now return a different value. </blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Anyway, you could look at the source and see if they are always called<br>
together, but it might be just as easy to just set both, and they<br>
aren't guaranteed to always be called together in future versions. </blockquote><div><br>i've currently removed the use of both functions (set_dispatch_status and set_wakeup_main) and i'm using the<br>my_wakeup_main() function (which i've written as you said) to wake up the main loop in case a new timeout/watch is toggled/added.<br>
i use this setup and dispatch in the mainloop while DATA_REMAINS.<br>in this use case, is there need for any of the notifications (dispatch status change or wakeup main)?<br><br>also - in your description of the wakeup_main function, are you implying there is a default function called to wake <br>
up the mainloop if i don't provide one? i haven't seen such in the source code. Are you simply referring to what is done by the standard <br>DBusWatch-es mechanism?<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> also an aside question: i've implemented the mainloop without timeouts (i<br>
> have stubs with debug_prints for the add_timeout/remove_timeout functions).<br>
> using the debug prints, i dont see these functions called during the<br>
> operation of the service. is imeplementing timeouts mandatory? </blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>They are used by DBusPendingCall for example to time out a method call.<br>
<font color="#888888"></font></blockquote><div><br>My service does not issue method calls, only responds to method calls from clients (and issues method returns)<br>and omits the occasional signal. can this explain the lack of timeouts i'm experiencing?<br>
<font color="#888888"><br>Regards,<br>Arik<br></font></div></div><br></div>