Comments needed: mozilla-sync needs a redesign

View: New views
2 Messages — Rating Filter:   Alert me  

Comments needed: mozilla-sync needs a redesign

by Henrik /KaarPoSoft-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Opensync-devel mailing list
Opensync-devel@...
https://lists.sourceforge.net/lists/listinfo/opensync-devel

Re: Comments needed: mozilla-sync needs a redesign

by Daniel Gollub-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Friday 23 October 2009 08:25:29 pm Henrik /KaarPoSoft wrote:

> 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
>

OpenSync plugins can be written as a seperated process, which is already
running. E.g. inside Mozilla. And communicate via FIFO

The plugin start-type is called OSYNC_START_TYPE_EXTERNAL - but AFAIK you
still need to use the OpenSync API, for proper communcation via this socket.

The only existing plugin-code running as external i could found is inside some
testcases:

tests/engine-tests/check_engine.c


-----8<-------
debug->plugin = osync_plugin_new(&error);
osync_plugin_set_name(debug->plugin, "mock-sync-foo");
osync_plugin_set_longname(debug->plugin, "Mock Sync Plugin");
osync_plugin_set_description(debug->plugin, "This is a pseudo plugin");
osync_plugin_set_start_type(debug->plugin, OSYNC_START_TYPE_EXTERNAL);
osync_plugin_set_config_type(debug->plugin, OSYNC_PLUGIN_NO_CONFIGURATION);


debug->client1 = osync_client_new(&error);
char *pipe_path = g_strdup_printf("%s/configs/group/1/pluginpipe", testbed);
osync_client_run_external(debug->client1, pipe_path, debug->plugin, &error);
---->8--------


Maybe this helps some how ... if you're interested in give this a try - let me
know. So we can build up a proof of concept up. We need something like that
anyway as reference implementation.

Best Regards,
Daniel

--
Daniel Gollub                        Geschaeftsfuehrer: Ralph Dehner
FOSS Developer                       Unternehmenssitz:  Vohburg
B1 Systems GmbH                      Amtsgericht:       Ingolstadt
Mobil: +49-(0)-160 47 73 970         Handelsregister:   HRB 3537
EMail: gollub@...          http://www.b1-systems.de

Adresse: B1 Systems GmbH, Osterfeldstraße 7, 85088 Vohburg
http://pgpkeys.pca.dfn.de/pks/lookup?op=get&search=0xED14B95C2F8CA78D

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Opensync-devel mailing list
Opensync-devel@...
https://lists.sourceforge.net/lists/listinfo/opensync-devel