PyCharm 2017.2 Help

Thread Concurrency Visualization

This feature is supported in the Professional edition only.


This feature helps gain full control over the multi-threaded applications. The concurrency visualization session runs with the current run/debug configuration in the Concurrency Diagram mode.

Starting the concurrency visualization session

  1. Do one of the following:
    • On the main menu, choose Run | Concurrency Diagram for <script name>.
    • On the context menu of the editor, choose Concurrency Diagram for <script name>.
    • Provided that the main toolbar or the navigation bar is visible, click /help/img/idea/2017.2/concurrency_visualization_icon.png.

The concurrency visualization diagram shows the real time states of threads inside the running process in the Threading graph tab of the Concurrent Activities Diagram tool window.

Concurrency visualization for the applications that use asyncio

Concurrency visualization also works well with the asyncio module introduced in Python 3.4.

To make use of the concurrency visualization, run the application that uses asyncio same way as described above, and then switch to Asyncio graph tab.

Working with the Concurrent Activities Diagram tool window

  • The left-hand side of the tool window contains the toolbox with the following icons:
    • /help/img/idea/2017.2/stop.gif - click this button to terminate the running process.
    • /help/img/idea/2017.2/erDiagramIconZoomIn.png/help/img/idea/2017.2/erDiagramIconZoomOut.png - click these buttons to increase or decrease scale of the diagram.
    • /help/img/idea/2017.2/icon_scrollToEnd.png - when the diagram is drawn for a long time and output is too long, then a scrollbar appears. When this button is pressed, this scrollbar is automatically scrolled to the end.
    • /help/img/idea/2017.2/close.png - click this button to close the tool window.
  • Next to the toolbox, there is the list of thread names; the right-hand side shows the waiting time for each thread:
  • Different states are marked with different colors. The legend is shown in the window.
  • To zoom in and out, use the magnifier glass icons in the toolbox, or Ctrl+mouse wheel.
  • To navigate to a particular stack frame, click the diagram.

Graphs' context menu

Right-clicking on a graph invokes a context menu with the following commands:

Show related locksThis command highlights on a graph all the thread expectations, which work with the same lock where a context menu has been invoked.
Hide related locksThis command hides the highlighting described above.

See Also


External Links:

Last modified: 9 August 2017