[gedit-list] Multithreading in gedit plugins
- From: Michael Zeising <michael michaels-website de>
- To: gedit-list gnome org
- Subject: [gedit-list] Multithreading in gedit plugins
- Date: Thu, 06 Dec 2007 10:50:44 +0100
Hi there,
I need to execute some tasks in parallel threads to not block gedit. To
initialize threading in PyGTK, I'm running "gtk.gdk.threads_init()" at
the top of my plugin's "__init__.py".
To thread a method I use the following decorator:
-----
import threading
def threaded(f):
"""
Threaded decorator
"""
def wrapper(*args):
t = threading.Thread(target=f, args=args)
t.start()
return wrapper
-----
When I apply this decorator like
-----
@threaded
def parseSomething(self):
do_stuff()
-----
the method is _never_ run and a segmentation fault occurs when I quit gedit.
Has anyone of you experienced this yet? I'd be really thankful for any
hint on how to solve this!
Thanks,
Michael
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]