[Sugar-devel] Is there a way to purposefully do synchronous GUI updates?

James Cameron quozl at laptop.org
Tue Aug 21 02:55:57 EDT 2012


On Tue, Aug 21, 2012 at 12:18:43PM +0530, Ajay Garg wrote:
> James,
> 
> Yes. Only one thread ACTUALLY executes on at any time on a
> uniprocessor system. That is logical.
> 
> But the thing is.. I am not at all wanting to speed up anything
> .. :P :P

I think you are wanting to speed up yourself, and that is a reasonable
goal.

> I am wanting to solve an issue, which in the present case seems
> possible ONLY by using two threads.
> 
> My intention is to somehow have GUI updates in a synchronous manner,
> and not rely upon "gobject.idle_add", which would have to have
> dividing a long workflow into many sub-parts, and chaining these
> sub-parts through "gobject.idle_add".  This is EXTREMELY painful,
> especially when one needs to do it on an already existing codebase.

Can you factor this in some python way so that you don't have to worry
about the implementation detail of calling idle_add?  How about a list
of lambda functions, or a list of method calls?

Can you be more specific about what code is afflicted by this problem?

> So, the two-thread workflow would make that easier. And yes, only
> one thread will execute any time; in fact, my suggested workflow
> takes advantage of this only-one-thread-running fact :D
> 
> At the same time, I also think that there is no easy way to do what
> I want. At least not without hacking onto the python-core code
> (event loop implementation).

I agree, you might need to work to make the python core and GTK+
handle threads as well.  I don't know the size of that work.

-- 
James Cameron
http://quozl.linux.org.au/


More information about the Sugar-devel mailing list