ljean / modbus-tk

Create Modbus app easily with Python
Other
566 stars 212 forks source link

Use of RLocks #97

Open desowin opened 6 years ago

desowin commented 6 years ago

Up to Python 3.1, RLocks are implemented in Python and hence are slower than Locks.

There are 4 places in modbus_tk where RLock is used. Regarding the modbus-tk library itself, it is fine to replace them all with (non-recursive) Locks - all uses in the library are perfectly fine without recurise locks. The RLock in Databank can be changed to Lock without any discrepancy to end users.

Changing of other RLocks into Lock would introducing following discrepancies for users:

What do you think about doing this change?

ljean commented 6 years ago

Hello,

Thanks for all this information. Do you have any benchmark about the performance issue cause by RLocks?

Unless it appears to be significant, i would not change if it can cause side-effects. If it appears to be significant, it may be an option... but the default should be ti use RLock.

Does it make sense?