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
I suspect this repo is no longer maintained (last update was 5 years ago) so this won't get fixed, but I'll report this just in case. Methods like ReadRegS16BE sound like they ought to be atomic, but they're not (e.g., https://github.com/d2r2/go-i2c/blob/master/i2c.go#L134-L139 shows that we write to the I2C device, and then read from it afterwards). If I try reading two different registers in two different goroutines, there are race conditions: I can get bad responses when the first goroutine writes the register to interact with, then the second one writes the register to interact with, then the first one reads the contents of the register.
I don't know if it's possible to fix this with the current implementation (reading/writing to the pseudofile in /dev, rather than using ioctl). The simpler way to address this might be to put a warning in the readme saying this library is not thread safe.
The text was updated successfully, but these errors were encountered:
I suspect this repo is no longer maintained (last update was 5 years ago) so this won't get fixed, but I'll report this just in case. Methods like
ReadRegS16BE
sound like they ought to be atomic, but they're not (e.g., https://github.com/d2r2/go-i2c/blob/master/i2c.go#L134-L139 shows that we write to the I2C device, and then read from it afterwards). If I try reading two different registers in two different goroutines, there are race conditions: I can get bad responses when the first goroutine writes the register to interact with, then the second one writes the register to interact with, then the first one reads the contents of the register.I don't know if it's possible to fix this with the current implementation (reading/writing to the pseudofile in
/dev
, rather than usingioctl
). The simpler way to address this might be to put a warning in the readme saying this library is not thread safe.The text was updated successfully, but these errors were encountered: