Fwd: Multi-threaded protocol plugin

Eion Robb eion at robbmob.com
Tue Jun 9 08:28:42 EDT 2015


Hi Alexander,

Libpurple itself isn't thread safe. That said, I've had great success with
calling back to the main thread using purple_timeout_add() and a timeout of
0, in the threaded protocols I've worked with in the past.

Curious to know what the protocol is you're working on and where we might
be able to see your source :)

Cheers,
Eion
On 9/06/2015 23:49, "Alexander Solovets" <asolovets at gmail.com> wrote:

> Hello!
>
> I am writing purple plugin for a custom, non-TCP protocol. >From what I
> learn from the source code it seems that all the plugins rely on
> purple_proxy_connect call which binds incoming messages to callback
> functions, so the plugin code doesn't have to worry about blocking the main
> thread. In my case I have a multi-threaded C++ library which exposes
> asynchronous calls for the protocol API, i.e. there is some class, which
> instance is running in a separate thread, with send/receive methods that do
> not block. Does libpurple have a helper code for such case? I'm not sure
> what I'm looking for exactly. Probably it can be a function to schedule a
> call in the main application thread, or a way to proxify the incoming
> traffic to libpurple.
>
> Thanks in advance!
>
> --
> Sincerely, Alexander
>
> _______________________________________________
> Devel mailing list
> Devel at pidgin.im
> https://pidgin.im/cgi-bin/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pidgin.im/pipermail/devel/attachments/20150610/1972819c/attachment.html>


More information about the Devel mailing list