You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Strictly speaking the write() does not do a real async write if the write buffer is empty. Even though the serial.write() is non blocking, doing a real write there is technically incorrect IMO.
In addition as there is a bug in the posix serial.write() where writing to a port that is not ready will cause it to enter a tight loop continously throwing an EAGAIN exception, so we end up effectively with a blocking write. See pyserial/pyserial#280.
The code I modified (and use) here does a real async write (every write gets buffered and executed asynchronously. This also avoids the aforementioned bug in serial.write().
If this is something you feel is the correct way to do it, let me know and I'll submit a PR.
I do undestand that issuing a genuine serial.write() if the buffer is empyy maybe more efficient so I could undersand why my solution may not be acceptible. (that is presuming the serial.write() bug is fixed). I have a workaround in the existing write() that I could submit that also avoids that bug, but keeps the instant write if the write buffer is empty.
The text was updated successfully, but these errors were encountered:
Strictly speaking the write() does not do a real async write if the write buffer is empty. Even though the serial.write() is non blocking, doing a real write there is technically incorrect IMO.
In addition as there is a bug in the posix serial.write() where writing to a port that is not ready will cause it to enter a tight loop continously throwing an EAGAIN exception, so we end up effectively with a blocking write. See pyserial/pyserial#280.
The code I modified (and use) here does a real async write (every write gets buffered and executed asynchronously. This also avoids the aforementioned bug in serial.write().
If this is something you feel is the correct way to do it, let me know and I'll submit a PR.
I do undestand that issuing a genuine serial.write() if the buffer is empyy maybe more efficient so I could undersand why my solution may not be acceptible. (that is presuming the serial.write() bug is fixed). I have a workaround in the existing write() that I could submit that also avoids that bug, but keeps the instant write if the write buffer is empty.
The text was updated successfully, but these errors were encountered: