Threading in Plasma applets
Sebastian Sauer
mail at dipe.org
Tue Feb 19 22:45:37 CET 2008
On Tuesday 19 February 2008, Aaron J. Seigo wrote:
> On Tuesday 19 February 2008, Richard Dale wrote:
> > were having problems too, which makes me think it might be some sort
> > of Ruby problem, rather than a QtRuby specific problem. Is that
> > possible?
>
> could be.. and yes, the kross based ScripEngines were dieing badly in
> threading related deaths while the same engines when running python scripts
> work fine.
well, threading should work. The reason why it was failing, is that there is
still a bit of testingcode within krossruby that doesn't seem to be
thread-safe (yet). Someone is able to work around this by removing the
#define KROSS_RUBY_EXPLICIT_GC
in kdebindings/ruby/krossruby/rubyconfig.h (should also increase the speed a
lot, that code does run the garbage collector at each possible step to
discover problems faster, but seems the gc is not very thread-friendly ;)
@richard; normaly it should be enough to;
const int critical = rb_thread_critical;
rb_thread_critical = Qtrue;
e.g. rb_funcall() ... (and while on that code, it may also an idea to wrap
rb_funcall's into rb_rescue2's to catch exceptions and prevent
rb_bug's/crashes and, not sure if that's really needed, to ruby_in_eval++ and
ruby_in_eval-- to prevent infinite loop's)
rb_thread_critical = critical;
Anyway. I still try to get the
playground/base/plasma/scriptengines/kross/examples/example_ruby_runner
working, but seems it still fails somehow. So, I am not able to test it aka
look if there are probably more bugs related to threading :-/
Attached is the patch I applied. I guess atm the problem is, that the
match+exec methods in kdebase/libs/plasma/scripting/runnerscript.h arn't
virtual any longer. So, somehow I miss how it needs to be changed to work
again :-/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plasmakross.diff
Type: text/x-diff
Size: 4236 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20080219/6cea73fc/attachment-0001.bin
More information about the Panel-devel
mailing list