[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Python plugin API locking (patch)
A Sex, 2003-10-03 ās 23:18, Marko Kreen escreveu:
> On Fri, Oct 03, 2003 at 10:34:41PM +0100, Gustavo J. A. M. Carneiro wrote:
> > This patch should protect all plugin API functions with a global
> > recursive mutex.
>
> Thats a cool patch, but it seems its not enough...
>
> You protect plugins from each other, thats cool, but at the
> moment plugin can run gtk signal loop, its not enough: now also
> xchat C code should go through locks, that means that locks
> should be in xchat core code. Thats what made me so worried...
>
> (Think of one thread having plugin lock and calling xchat
> functions, another thread running gtk.mainloop - now there
> are 2 threads inside xchat core)
Of course, you can only protect xchat plugin threads from each other.
You cannot protect the xchat internal data structures from xchat core
code if it bypasses the xchat plugin API and accesses the data
structures directly.
Still, better than nothing :P It avoids the need for each plugin to do
their own locking.
Of course, you already know what I really think about threads in xchat
plugins, don't you? :)
--
Gustavo J. A. M. Carneiro
<gjc@inescporto.pt> <gustavo@users.sourceforge.net>
--
XChat-discuss: mailing list for XChat users
Archive: http://mail.nl.linux.org/xchat-discuss/