Skip to content

Java implementation of many readers one writer problem, ready to use

License

Notifications You must be signed in to change notification settings

oscar-besga-panel/JManyReadersOneWriter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JManyReadersOneWriter

Introducction

Java implementation of many readers one writer problem, ready to use.

See discussion here: https://codereview.stackexchange.com/questions/216603/many-readers-one-writer-with-semaphores-and-multithreading

Howto

Well, as it is apache licence, you may use as you want.
The preferred method would be to inherit org.obapanel.jmanyreadersonewriter.AbsrtactReadersWriter and write the critical sections on the abstract methods executeReading and executeWriting.
Then instantiate the class and call read and write as you need.

See examples on org.obapanel.jmanyreadersonewriter.example.ExampleFileReadersWriter

Source

Original ides was taken from this original discussion: https://codereview.stackexchange.com/questions/127234/reader-writers-problem-using-semaphores-in-java?newreg=afcfc71833ab4152b20bffdaccd175d7

And from this wikipedia entry: https://en.wikipedia.org/wiki/Readers%E2%80%93writers_problem

Other implementations I took a look:

Disclaimer

This library is done as an programming exercice, but you could use the basic java reader writer implementation
https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/locks/ReadWriteLock.html

About

Java implementation of many readers one writer problem, ready to use

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages