IntelliJ Platform Plugin SDK
 
IntelliJ Platform Explorer

Threading Model

Edit pageLast modified: 24 February 2025

The IntelliJ Platform is a highly concurrent environment. Code is executed in many threads simultaneously. In general, as in a regular Swing application, threads can be categorized into two main groups:

  • Event Dispatch Thread (EDT) – also known as the UI thread. Its main purpose is handling UI events (such as reacting to clicking a button or updating the UI), but the platform uses it also for writing data. EDT executes events taken from the Event Queue. Operations performed on EDT must be as fast as possible to not block other events in the queue and freeze the UI.

  • background threads (BGT) – used for performing long-running and costly operations, or background tasks.

There is only one EDT and multiple BGT in the running application:

UI task task task UI task task write task task UI task task write UI task task task UI task task write task EDTBGT 1BGT 2...BGT N

It is possible to switch between BGT and EDT in both directions. Operations can be scheduled to execute on EDT from BGT (and EDT) with invokeLater() methods (see the rest of this page for details). Executing on BGT from EDT can be achieved with background processes.