Polkadex-Substrate / polkadexTEE-worker

Polkadex Off-chain Orderbook
Apache License 2.0
10 stars 1 forks source link

Investigate exchange of Mutexes with Read Write Lock #314

Open haerdib opened 2 years ago

haerdib commented 2 years ago

Currently we're locking everything a mutex to guarantee thread safety. That might be an overkill because simultaneous reads could be allowed to speed things up.

However, just exchanging everything with a RW lock will not be safe, as we need to somehow ensure that a write lock will not be waiting forever because reading access can be overlapping-