[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: zed: When will the new PI be done?



> Sounds pretty similar to my queue system. The only disadvantage that I
> can see is that you can't force only a few things to happen every cycle.
> If any Python code wants to lock up X-Chat, it simply waits until the
> lock is released in the next cycle, and then runs an infinite loop. The
> function in your plugin, that releases the lock so Python code can run,
> would never return and return control to X-Chat, and X-Chat would lock
> up.
[...]

No, that's not possible. There are no python functions lefting the lock
acquired after returning. It's a simple "lock, xchat_function, unlock"
procedure, so the function releasing the lock would be called so many
times as the lock function.  Even in an infinite loop the python plugin
will still pass control back to xchat after a few interactions, because
both are fighting for the lock. Indeed, I've tested the system with a
few dozen threads, and the results are just fine. I can't see any reason
to implement something more complex than that right now.

-- 
Gustavo Niemeyer

[ 2AAC 7928 0FBF 0299 5EB5  60E2 2253 B29A 6664 3A0C ]
--
XChat-discuss: mailing list for XChat users
Archive:       http://mail.nl.linux.org/xchat-discuss/