Thread safety of client #2662
-
Hi, I'm a bit confused about the thread safety of the Pymodbus client. As mentioned in the documentation:
Does this mean that running multiple asynchronous client objects is fine, but each individual client should only be called one at a time? Could you confirm if I understand correctly? Thank you in advance :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It means what it says, you cannot have 2 threads each calling the same client object without some sort of lock. pymodbus do have a locks in place to prevent 2 calls from running simultaneously, but that can easily cause a dead-lock situation in the app code... hence this "safety statement". |
Beta Was this translation helpful? Give feedback.
It means what it says, you cannot have 2 threads each calling the same client object without some sort of lock.
pymodbus do have a locks in place to prevent 2 calls from running simultaneously, but that can easily cause a dead-lock situation in the app code... hence this "safety statement".