[GSoC] Thread-safe libpurple
mark at kingant.net
Thu Apr 3 11:03:42 EDT 2008
On Wed, 02 Apr 2008 02:11:56 +0100, Maciek Wiercinski wrote
> I have applied for GSoC for XMPP Standards Foundation with idea to
> create an universal XMPP transport using libpurple. I'm aware that
> libpurple is not thread-safe, thus I will have to make it such to
> avoid scalability issues. I was suggested by Andreas Monitzer to
> move static variables to Thread-local storage.
> I've already found some things which will have to be moved,
> however I'm not really familiar with libpurple source, so I have
> the question - how big is that task? I have decent C skills and
> experience in parallel programming, but little knowledge of the
> libpurple. How much time do you think it may take?
I'm not very experienced with threaded programming, but I think this would be
a difficult task. The libpurple code base is fairly large, and we've never
worried about thread safey in the past, so you would probably have to make a
large number of changes.
And that's only one part of this project... you would still have to write the
glue code for acting as jabber transports.
I'm not convinced that using multiple threads is the best approach. You could
just use a single process with one thread and add a PurpleAccount for each
connection. Or you could spawn a new process for each connection. This has
the benefit of not killing everyone's connection if it crashes.
More information about the Devel