-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read Write locks #105
Comments
Interesting proposition, if I understand correctly you basically need the same concurrent bookkeeping this library already has, but with keys mapped to a ReaderWriterLockSlim. Then you would probably want methods like I would definitely be willing to help and review this |
Yes exactly. There are also some methods for upgradeable read... Usage for me is in cache implementation, where there are many reads and if update, delete, reset occurs then all reads should be locked until operation is done. For upgrade... if first read will trigger cache initialization then I should switch to write and all other reads should wait until it's initialized. For keyed part... there are many caches and all these should have their own instances of locks. Currently in this lib all locks are write locks so if there is lock then all others are in waiting list. Looks like methods for Read (and upgradeable read) should be added. But I understand this part can be PR for this lib and I can be author for that :) |
Sounds good! If you set up an initial PR we can work from there. I would like to keep the changes to the existing code as minimal as possible by the way, because I'm running a bunch of mission critical software with it. But we can see where this leads. 👍 |
Could read lock also be implemented?
For now I use ReaderWriterLockSlim for this and for key based access I added dictinoary to hold instances... keyed-semaphore already have this for write part... If only many-reads part could be added here... :)
The text was updated successfully, but these errors were encountered: