-
Notifications
You must be signed in to change notification settings - Fork 735
Open
Milestone
Description
Describe the bug
After the first call of MainLoop.Invoke, the application starts consuming 1 CPU core (100%) on Linux and macOS.
To Reproduce
Steps to reproduce the behavior:
- Install .NET SDK 8.0.100 on Linux or macOS
- Create a new .NET 8 Console Application:
dotnet new console -f net8.0 - Install Terminal.Gui 1.14.1:
dotnet add package Terminal.Gui --version 1.14.1 - Put the following code in
Program.cs:
using Terminal.Gui;
Application.Run<MyWindow>();
Application.Shutdown();
public class MyWindow : Window
{
public MyWindow()
{
Application.MainLoop.Invoke(() => { });
}
}- Run the program:
dotnet run - Check out the processes with the highest CPU usage:
ps -eo pid,%cpu,command -r | head - You should see your freshly running application with CPU usage of ~100%
Expected behavior
MainLoop.Invoke should not cause stable CPU usage. Before the first call of MainLoop.Invoke, the application CPU usage is quite low, which is also the expected behavior for the application after this call.
Environment
OS: Linux, macOS
Checked Terminal.Gui versions: 1.13.5, 1.14.1
Checked .NET versions: 7.0.14, 8.0.0
Screenshots
I have used Rider to get a dotTrace performance snapshot. Here are the corresponding screenshots:
auduchinok, HermanKirshin, ArtManyak, ForNeVeR, thisisvolatile and 5 more
Metadata
Metadata
Assignees
Type
Projects
Status
✅ Done

