jorticus / hexlight-gui

HexLight GUI - RGB LED controller, supporting advanced colour models.
MIT License
3 stars 1 forks source link

Make comms thread-safe #4

Open jorticus opened 10 years ago

jorticus commented 10 years ago

The current implementation of verifying ACK when sending a command doesn't work if you send two commands at the same time (eg. from different threads). Implement some sort of receive queue and use callbacks instead of blocking?? Exceptions could be raised long after the command has been sent?

Furthermore, there is no locking performed when actually writing or constructing the packet, so two threads sending at the same time will likely cause problems.

jorticus commented 9 years ago

Solution for now - only update controller through the updateTimer thread