Re: [evolution-patches] [calendar] fix for #60736



On Fri, 2004-07-23 at 08:18 +0200, Rodrigo Moya wrote:
On Fri, 2004-07-23 at 12:00 +0800, Not Zed wrote:
> 
> Will this actually make any difference?
> 
> The backtrace doesn't show the idle handler being recursively called,
> which I presume can't happen anyway.  The idle handler will implictly
> be removed automagically when it returns FALSE.  So explictly removing
> it is redundant.
> 
there are calls in those idle handlers that could trigger some calls to
the idle handler again.
I thought glib wont call idle handlers recursively?  If it did the whole idle handler thing wouldn't work very well and you'd be getting inifinite recursion all over the place.

> That code seems over-complicated for what it does and prone to
> issues :-/
> 
yes, the problem is that both the auth and the signal callbacks need to
be run on the main thread, since they need to get the signals to the
client. Do you have any suggestion for making it less complicated?

Well the mailer uses a (global) queue of password requests.  If an existing password request is open it just queues it and goes to sleep, otherwise it queues it and also fires off a message to the main loop to process it (equivalent of adding an idle callback).  After the password is requested it returns the result and checks the queue, if its non-empty it runs another one.  It also has a bit of messy stuff to handle being called from the mainloop without causing deadlocks.

This also lets the password request run asynchronously and outside of any locks.  It doesn't need the lock around the password request since password requests are all serialised (globally) already.  This also stops you getting multiple requests showing up at once and making sure they run in the right order.  And especially stops re-asking for the same value that you've already got (if that issue still exists??).

I would probably:
--
Michael Zucchi <notzed ximian com>
"born to die, live to work, it's all downhill from here"
Novell's Evolution and Free Software Developer


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