|
From: Henrik /K. <he...@ka...> - 2009-10-23 18:25:40
|
mozilla-sync needs a redesign. Currently, mozilla-sync is a threaded plugin to OpenSync. It will initialize a private instance of XPCOM and access address-books etc. as it works as an OpenSync plugin. Now, this approach is broken by design, since the Mozilla/Thunderbird/XPCOM functions are not thread safe. If the Thunderbird GUI is running in another process, all kinds of disasters may happen because of the lack of thead/process safety. Even worse: the blueZync GUI (an extension to Thunderbird) runs OpenSync (in it's own thread) so here, for sure, we have a problem due to the lack of thead/process safety. One possible solution would be to implement some process/thread in Thunderbird to listen for custom messages from a modified version of mozilla-sync. I.e. to keep the mozilla-sync threaded, but instead of letting it access XPCOM data directly, it would implement some proprietary protocol to talk to a proprietary listener in Thunderbird. This seems to be an unnecessary complication, as OpenSync already has process communication capabilities. So here is my current idea: 1) Create a listening socket in a running Thunderbird GUI. This socket would listen for OpenSync messages, and act accordingly. 2) Convince OpenSync to talk to this socket, instead of OpenSync's normal sub-thread/sub-process I still have only limited knowledge of OpenSync, so I don't know: - how to convince OpenSync to talk to the Thunderbird socket, instead of to an OpenSync plugin. - which messages in which format to send or receive - how to do this in Thunderbird Any comments / help / hints / etc on this would be most appreciated. /Henrik |