문제

If I open a serial port in thread 1 and then close it, I can open it in thread 2 and use it. In that way, I can allow multiple threads to communicate with the same port, as long as each thread closes the port and the next thread opens it.

But would it be possible to open a port in thread 1 and then communicate with it in thread 2, without closing it in thread 1 and without opening it in thread 2? Particularly for Windows?

도움이 되었습니까?

해결책

Yes, it's possible to open a serial port once and let multiple threads communicate on it. Each thread needs to know the handle of the serial port, though.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top