jcurl / RJCP.DLL.SerialPortStream

SerialPortStream is an independent implementation of System.IO.Ports.SerialPort and SerialStream for better reliability and maintainability. Default branch is 2.x and now has support for Mono with help of a C library.
Microsoft Public License
624 stars 197 forks source link

RPI3 CPU 180% #68

Closed JTrotta closed 5 years ago

JTrotta commented 5 years ago

Just testing the library with 2 port. The only ports opening consume 180%, opening 1 port 90%. Version 2.1.4.0, and mono 5.14.0.177 Any hints?

EDIT: I recompiled the library without the pin PinChangeThread, and cpu is nomal now //try { // m_MonitorPins = true; // m_PinThread = new Thread(new ThreadStart(PinChangeThread)); // m_PinThread.Name = "NSerPin_" + m_Name; // m_PinThread.IsBackground = true; // m_PinThread.Start(); //} catch { // m_PinThread = null; // m_MonitorPins = false; // throw; //}

jcurl commented 5 years ago

Yes, it's likely a duplicate to this: https://github.com/jcurl/SerialPortStream/issues/22. I don't have an RPI3 to debug, as the fix itself must be in the libnserial library. I'll be closing this as a duplicate to that ticket. If you're capable, you can provide a patch, which I can integrate (and perhaps modify), after you test.