Tips & Tricks

  1. Don't use any blocking functions in the sensitive threads. The sensitive threads are the MainThread that performs all calls to the GUI library (so slowing that down halts the user interface) and the network thread, usually called ABCLaunchManyThread-X of which there is only one, so slowing that down will stop *all* network traffic of Tribler. The network thread can be highly sensitive, we have had a case where even allocating a database wrapper (e.g. PeerDBHandler()) too often brought download speeds to zero.
  1. Don't let any other thread than the MainThread call the GUI library (wx). On Linux this will mess up the GUI completely, on Windows this sometimes leads to crashes as the GUI library is not thread safe. Hence, use wx.CallAfter(function) to delegate GUI updates from a thread to the MainThread. Previously we used our own invokeLater () method (see safeguiupdate.py) for this, but we should phase that out.