On Fri, 2005-01-04 at 13:52 +0200, Antoon Pardon wrote:
> On Thu, Mar 31, 2005 at 10:12:12PM -0800, Brian wrote:
> > On Thu, 2005-31-03 at 11:39 +0200, LÃszlà Monda wrote:
> > > On Wed, 2005-03-30 at 19:54 -0800, John Finlay wrote:
> > > > LÃszlà Monda wrote:
> > 
> > > > >Could anyone shed some lights on what's really going on here?
> > > 
> > > Well, problem solved, great.  There were some minor errors in the code
> > > beyond thread.start().  I corrected them all and attached the source.
> > > 
> > > It would make a nice threading example IMO.  I don't remember any
> > > examples where more than one thread would manipulate the GUI
> > > simultaneously.  Someone could add it to some parts of the documentation
> > > or should I contact with a documentation manintainer?
> > > 
> > 
> > Here is a different way for threads to communicate between each other.
> > This way you can keep all GUI stuff in one thread only.  I have updated
> > the example code to include some of your examples features.
> > 
> > The dispatcher code has been created to be very generic so that it can
> > pass most any data between threads safely.   The majority of the code
> 
> I fear that your code can become very unresponsive in particular
> circumstances. AFAICS you have no saveguard against multiple threads
> producing data more rapidly than the gtk-thread can handle.
> 
> My experience is that when that happens, resons suffers.
> 

Actually I just changed the other example to 4 threads and it stalled
out the whole desktop. The mouse was even extremely unresponsive.  I
changed mine to 4 threads, even commented out the sleep time.  The
window did not update ongoing but stayed blank till about half way thru,
then updated again at the end.  The desktop remained responsive
throughout.

The reason the desktop remained responsive is that the dispatcher() uses
a queue to pass the data which will store up the data until the gui
thread retrieves it.  
-- 
Brian <[EMAIL PROTECTED]>

_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to