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
Use of I2C in TinyGo is not "thread-safe".
HAL would not use mutex to serialise concurrent access. Synchronisation when needed, must be done in application code.
This is contra, for example, to Linux I2C driver that uses internal mutex to enable easy concurrent usage.
Arguments against implementing such internal mutex in TinyGo (from slack):
it is usually not necessary [in embedded systems] and thus introduces overhead
easy to add but impossible to remove (for backwards compatibility reasons)
Note that in the case of Linux, the kernel has to synchronize access to the I2C bus for safe operation. I'm pretty sure the hardware will misbehave when access isn't synchronized which would be unacceptable when done from an unprivileged process. So I think it's also a security feature, not just a convenience feature. This security argument doesn't apply to TinyGo.
Use of I2C in TinyGo is not "thread-safe".
HAL would not use mutex to serialise concurrent access. Synchronisation when needed, must be done in application code.
This is contra, for example, to Linux I2C driver that uses internal mutex to enable easy concurrent usage.
Arguments against implementing such internal mutex in TinyGo (from slack):
Page: https://tinygo.org/docs/concepts/peripherals/i2c/
The text was updated successfully, but these errors were encountered: