From Fedora Project Wiki
Line 14: Line 14:
== Detailed Description ==
== Detailed Description ==


Anaconda's GTK UI and the backend are running in the same thread. GTK is unfortunately not designed to be run in the same thread as the app. Although this arrangement sort of works for the moment problems can be noticed: for instance on a virtual machine (slow) there is a visible lag between the time "scanning storage devices" dialog pops up and the time this dialog gets window decorations by metacity. What we do at the moment when we want to update the UI and the processing happens outside of the gtk.main function is calling gtk.main_iteration(False) to manually enforce one gtk main loop. Coming to #pygtk at gnome's IRC I was repeatedly told by the gurus that this is a hack bound to randomly fail to accomplish what we expect.
Anaconda's GTK UI and the backend are running in the same thread. GTK is unfortunately not designed to be run in the same thread as the app. Although this arrangement sort of works for the moment problems can be noticed: for instance on a virtual machine (slow) there is a visible lag between the time "scanning storage devices" dialog pops up and the time this dialog gets window decorations by metacity. What we do at the moment when we want to update the UI and the processing happens outside of the gtk.main function is calling <code>gtk.main_iteration(False)</code> (or <code>window.show_now()</code>)to manually enforce one gtk main loop. Coming to #pygtk at gnome's IRC I was repeatedly told by the gurus that this is a hack bound to randomly fail to accomplish what we expect.


Also separating the threads will allow us to do certain tasks in the background, not blocking the user from continuing with other parts of installation. For instance Anaconda can already be initializing the filesystem while the user is picking packages to be installed.
Also separating the threads will allow us to do certain tasks in the background, not blocking the user from continuing with other parts of installation. For instance Anaconda can already be initializing the filesystem while the user is picking packages to be installed.

Revision as of 09:57, 11 February 2011

Threaded Anaconda GUI

Summary

Do not run the gtk.main() in the same thread as all other processing (e.g. probing storage devices or installing packages).

Owner

  • Name: Ales Kozumplik

Current status

  • Targeted release: Fedora X
  • Last updated: 08:37, 12 January 2011 (UTC)
  • Percentage of completion: 1%

Detailed Description

Anaconda's GTK UI and the backend are running in the same thread. GTK is unfortunately not designed to be run in the same thread as the app. Although this arrangement sort of works for the moment problems can be noticed: for instance on a virtual machine (slow) there is a visible lag between the time "scanning storage devices" dialog pops up and the time this dialog gets window decorations by metacity. What we do at the moment when we want to update the UI and the processing happens outside of the gtk.main function is calling gtk.main_iteration(False) (or window.show_now())to manually enforce one gtk main loop. Coming to #pygtk at gnome's IRC I was repeatedly told by the gurus that this is a hack bound to randomly fail to accomplish what we expect.

Also separating the threads will allow us to do certain tasks in the background, not blocking the user from continuing with other parts of installation. For instance Anaconda can already be initializing the filesystem while the user is picking packages to be installed.

Bugzilla to track this is https://bugzilla.redhat.com/show_bug.cgi?id=581912.

fixing dispatch.py

It might be necessary to fix/replace dispatch.py to do this. Problems with the current implementation:

  • it is difficult to be sure whether a particular step is going to be skipped or not in the end
  • we are modelling a queue with much more complex structure, that makes the possible interactions (step forward, step backward) difficult to figure out
  • the string binding
  • intermixing interactive and direct steps at the same place (is this a problem?)
  • dispatch.py is too much entangled with gui.py. This results in a couple of architecture flaws:
    • for the first few indirect steps are executed when the gtk.main() function is not yet running
    • it is actually the gui.py that decides when the steps are changing, not the dispatch!

A solution suggested by msivak is to have every step at its start check it has all necessary information. If not raise an exception that mentions all steps that need to happen before this step in order to collect all needed information: those will be added before the current step in the queue and the queue is re-executed from the start.

Benefit to Fedora

Improved experience for the installer users.

Scope

Huge and but limited to anaconda.

Test Plan

User Experience

Dependencies

Contingency Plan

Documentation

Release Notes