Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

CodeWebWeaver/jv-multithreading-read-write-list

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Read-write list

Implement methods in ReadWriteList class so that multiple threads could read data at the same time as long as there’s no thread that is updating the data. Only one thread can update the data at a time causing other threads (both readers and writers) to block until the update is over.

Use ReadWriteLock implementation for this purpose.

In your solution you should lock and unlock read and write locks in order to fulfill the conditions above. Remember to use try-finally construct - you want to release the lock even if the operation with the underlying list was not successful.

You can run main() to check your solution.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Java 100.0%