[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[pygtk] Pygtk does not play nicely with speech-dispatcher
From: |
Hemant Goyal |
Subject: |
[pygtk] Pygtk does not play nicely with speech-dispatcher |
Date: |
Tue, 29 Apr 2008 01:04:52 +0530 |
Hi,
I was reading through the conversation and while I am no expert what I
realized was that a lot of background networking tasks are executed in
separate threads when pyGTK is used. There is a standardized method that
needs to be followed when such network processing has to be combined with UI
updating. It has been elegantly explained here :
http://aruiz.typepad.com/siliconisland/2006/04/threads_on_pygt.html
Best,
Hemant
On Mon, Apr 28, 2008 at 2:06 PM, Hynek Hanke <hanke at brailcom.org> wrote:
> John Finlay napsal(a):
>
> > The problem is that gtk and by extension pygtk has an event loop, and
> > the python speechd api has implemented its own event loop within a thread.
> > The speechd protocol is synchronous and sounds similar to RPCs. This event
> > loop conflict was in general a problem with RPC programming with GUIs. The
> > best solution is to integrate the two event loops using io_add_watch but
> > that would entail throwing away the python speechd api and you would not
> > have to use threads. This is the course I would take if I was doing your
> > project.
> >
> Hello John,
>
> please, I'm quite confused with this, because I have no experience with
> pygtk. What kind of conflict do you speak about? Do you propose the Speech
> Dispatcher Python API to be changed in some way?
>
> The protocol itself is synchronous TCP protocol except for the events,
> which are handled asynchronously. Thus the Python API handles the
> communication and calls event callbacks in a separate thread. This should be
> totally independent of the pygtk event loop, isn't it?
>
> > If you want to use the speechd python api you have to make your pygtk
> > program threaded
> > and that is more than just calling threads_init.
> >
> What else then needs to be done by a program if it wants to use pygtk in
> combination with another library that uses threads?
>
> Thanks for your help,
> Hynek Hanke
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.freebsoft.org/pipermail/speechd/attachments/20080429/ab98a945/attachment.htm
- Problems with "end" callback in Python, (continued)
- Problems with "end" callback in Python, James Simmons, 2008/04/22
- Problems with "end" callback in Python, Hynek Hanke, 2008/04/23
- Pygtk does not play nicely with speech-dispatcher, James Simmons, 2008/04/24
- [pygtk] Pygtk does not play nicely with speech-dispatcher, Dave Aitel, 2008/04/24
- [pygtk] Pygtk does not play nicely with speech-dispatcher, James Simmons, 2008/04/24
- [pygtk] Pygtk does not play nicely with speech-dispatcher, Michael Urman, 2008/04/24
- [pygtk] Pygtk does not play nicely with speech-dispatcher, James Simmons, 2008/04/25
- [pygtk] Pygtk does not play nicely with speech-dispatcher, Dave Aitel, 2008/04/25
- [pygtk] Pygtk does not play nicely with speech-dispatcher, John Finlay, 2008/04/25
- [pygtk] Pygtk does not play nicely with speech-dispatcher, Hynek Hanke, 2008/04/28
- [pygtk] Pygtk does not play nicely with speech-dispatcher,
Hemant Goyal <=