Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jonasmalacofilho/rwlock
Readers-writer lock for Haxe
https://github.com/jonasmalacofilho/rwlock
Last synced: 25 days ago
JSON representation
Readers-writer lock for Haxe
- Host: GitHub
- URL: https://github.com/jonasmalacofilho/rwlock
- Owner: jonasmalacofilho
- License: other
- Created: 2014-06-05T22:02:47.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-26T11:12:50.000Z (almost 10 years ago)
- Last Synced: 2023-06-16T03:35:22.847Z (over 1 year ago)
- Language: Haxe
- Homepage:
- Size: 163 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Readers-writer lock
===================API
---### Creation
new( maxReaders, ?waitLogTimeout, ?waitLogger)
### Func level
read(func, ?wait)
write(func, ?wait)### Imp level
// read
prepareRead(?wait)
releaseRead()// write
prepareWrite(?wait)
releaseWrite()// read -> write -> read
convertToWriting(wait)
backToReading()### Low level
Don't use. Is only exposed if READ_WRITE_LOCK_SUPER is defined.
Performance
-----------### Definitions:
First, let's create some objets:
k: a lock
R: number of readers
W: number of writers
For simplificity, suppose we have 1 operation/reader and 1 operation/writer.
What about the relationship between reading and writing times (complexity)?
Open for now ...tr = ?
tw = ?
tr ? tw...
Good benefits for readers but, for writers, it depends on server contention.