the use of threading.lock() in the performance example #1269
Replies: 4 comments 1 reply
-
I am not aware that is has been reworked, that is basically the reason why it is in the v2.5.3 directory. When reworked it will move up to the other updated examples. In version 3.x we do not use locks in tests. |
Beta Was this translation helpful? Give feedback.
-
Thanks |
Beta Was this translation helpful? Give feedback.
-
The code was rewritten (not the example) and I am sure when the example gets rewritten it will be without a lock(). That is not the same as to say applications never need to use locks, just that the performance example do not need it. |
Beta Was this translation helpful? Give feedback.
-
by the way, there is a lock in the transaction manager, where the request is processed, if I am correct.... pymodbus/pymodbus/transaction.py Line 63 in 94fa6b1 pymodbus/pymodbus/transaction.py Line 124 in 94fa6b1 used in the base client pymodbus/pymodbus/client/base.py Line 134 in 94fa6b1 I need more time to understand things, asyncio is not so easy to decrypt for me |
Beta Was this translation helpful? Give feedback.
-
I can see that the performance example has been reworked
https://github.com/pymodbus-dev/pymodbus/blob/dev/examples/v2.5.3/performance.py
you do not use anymore the threading.lock() in the test, even if the variable is still in the code
pymodbus/examples/v2.5.3/performance.py
Line 34 in ab83cc8
I guess it is because the test covers modbus tcp ?
If testing in modbus rtu,the lock would be necessary ?
Sorry if I am misunderstanding things...
best
Alex
Beta Was this translation helpful? Give feedback.
All reactions