You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just discovered this project; it looks like you guys have put together a very nice suite of utilities.
It looks like you don't have a read-write lock yet (one which allows multiple concurrent readers, but only one concurrent writing). A couple years ago, I needed one for a Ruby project and couldn't find anything good, so I developed my own implementation. Here it is: https://github.com/alexdowad/showcase/blob/master/ruby-threads/read_write_lock.rb
I put a fair amount of time into testing and verifying this implementation, and also had a couple of other Ruby developers do code review and test it on their machines as well. It has worked in production for me, without any problems detected. So while more review would be good, it is already somewhat mature.
A RW lock which "spins" when the lock is taken would be lighter (less memory footprint per lock), but is more "dangerous" -- the user needs to know what they are doing when they select such a lock.
If you would like to use this RW lock, please take it and distribute it under your existing license conditions. Of course, I may also use it in other places and distribute it under other licenses.
The text was updated successfully, but these errors were encountered:
@alexdowad Thank you for your kind words, and for the offer of your code. I think a read-write lock would be an excellent addition to our toolset. And @chrisseaton will be especially pleased that you included benchmark tests (he's a staunch advocate of performance testing). Would you like to submit this as a PR so that your name gets in the commit log?
@alexdowadhttps://github.com/alexdowad Thank you for your kind words,
and for the offer of your code. I think a read-write lock would be an
excellent addition to our toolset. And @chrisseaton https://github.com/chrisseaton will be especially pleased that you
included benchmark tests (he's a staunch advocate of performance testing).
Would you like to submit this as a PR so that your name gets in the commit
log?
—
Reply to this email directly or view it on GitHub #146 (comment)
.
Just discovered this project; it looks like you guys have put together a very nice suite of utilities.
It looks like you don't have a read-write lock yet (one which allows multiple concurrent readers, but only one concurrent writing). A couple years ago, I needed one for a Ruby project and couldn't find anything good, so I developed my own implementation. Here it is: https://github.com/alexdowad/showcase/blob/master/ruby-threads/read_write_lock.rb
I put a fair amount of time into testing and verifying this implementation, and also had a couple of other Ruby developers do code review and test it on their machines as well. It has worked in production for me, without any problems detected. So while more review would be good, it is already somewhat mature.
A RW lock which "spins" when the lock is taken would be lighter (less memory footprint per lock), but is more "dangerous" -- the user needs to know what they are doing when they select such a lock.
If you would like to use this RW lock, please take it and distribute it under your existing license conditions. Of course, I may also use it in other places and distribute it under other licenses.
The text was updated successfully, but these errors were encountered: