Thread Concurrency Visualization | PyCharm (original) (raw)

Overview

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:
  2. Go to .
    Run Concurrency Diagram from the main menu
  3. Click More Actions More Actions in the Run widget at the top of the PyCharm window and select Concurrency Diagram for < script_name>.
    Run Concurrency Diagram from the Run widget
  4. Right-click a target file in the editor and select .
    Run Concurrency Diagram from the context menu
  5. Provided that the main toolbar or the navigation bar is visible, click Run concurrency diagram and select .

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 available in Python 3.5 and later.

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.

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

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

Last modified: 17 June 2024