-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
High CPU usage #2
Comments
Can you share more details? SimpleCom would consume a lot of CPU time when a lot of chars are shown. I want to know the issue is saw when idle state on serial line. |
When idle it uses up to 25% of CPU, but it usually hovers around 20%. |
I've not yet reproduce this issue on my Raspberry Pi 2. Can you share thread stack via Process Explorer?
Usually 2 threads are available in Threads tab. I want to check how SimpleCom works on your PC. |
Thank you for sharing! But it is not a bug, so I close this issue. Thread 2812 consumes a lot of CPU time. This thread is cause of high CPU usage. Thus I close this issue - you need to investigate your La Frite or its OS. |
I've not been able to reproduce it yet with my Raspberry Pi 4 (w/ Raspberry Pi OS for AArch64).
Can you prove it? e.g. insert debug code in SimpleCom. |
Hello, at first I thought you were asking what remote device the serial port was connected to, and that doesn't make a difference. It doesn't have to be connected to anything. But then maybe you are actually asking what is the USB device that is providing the COM port? The USB to serial cable is an FTDI chip based StarTech ICUSB2321F:
The same CPU usage does not occur when using Tera Term, PuTTY, or MTTTY. |
I want to know what device did you communicate on serial line because peripheral device (or its terminal) might not support VT100. It relates to #6 . If you can modify SimpleCom, I want to know what characters were sent from peripheral. I can help you to debug. |
It started occurring again, and I profiled it: In I've narrowed it down to not setting any Also, there are a lot of Win32 API calls with no error checking or handling. For example the call Adding something like this after COMMTIMEOUTS comm_timeouts;
if (!GetCommTimeouts(hSerial, &comm_timeouts))
{
DWORD last_error = GetLastError();
OutputDebugString(_T("GetCommTimeouts failed.\r\n"));
}
comm_timeouts.ReadIntervalTimeout = 1;
comm_timeouts.ReadTotalTimeoutMultiplier = 0;
comm_timeouts.ReadTotalTimeoutConstant = 10;
comm_timeouts.WriteTotalTimeoutMultiplier = 0;
comm_timeouts.WriteTotalTimeoutConstant = 0;
if (!SetCommTimeouts(hSerial, &comm_timeouts))
{
DWORD last_error = GetLastError();
OutputDebugString(_T("SetCommTimeouts failed.\r\n"));
} In |
Thanks @ngbrown for sharing details!
I wonder why my Raspberry Pi 4 does not happen it... The behavior might be different in each devices (it might not only peripheral - includes serial adaptor on Windows host).
Basically I want to throw
I think
I saw some incorrect behavior when I use buffer at there, but I cannot remember details. |
I started using SimpleCom in order to connect to my serial devices, and I've gotta say that it's really cool to be able to use it inside Windows Terminal.
The only problem I found is that it's using a lot of my CPU and I've no idea if it's a widespread issue.
The text was updated successfully, but these errors were encountered: