iluwatar / java-design-patterns

Design patterns implemented in Java
https://java-design-patterns.com
Other
90.14k stars 26.64k forks source link

Lock Manager pattern #1283

Open iluwatar opened 4 years ago

iluwatar commented 4 years ago

Description: The Lock Manager design pattern is a concurrency control mechanism used to manage access to shared resources in a multi-threaded environment. This pattern ensures that multiple processes or threads do not simultaneously access a shared resource in a way that causes conflicts. The key elements of the Lock Manager design pattern include:

  1. Lock Management: Centralized control for acquiring and releasing locks on resources.
  2. Lock Types: Different types of locks, such as read and write locks, to manage varying levels of access control.
  3. Deadlock Detection and Resolution: Mechanisms to detect and handle deadlocks.
  4. Lock Granularity: Ability to define locks at different levels of granularity, such as fine-grained or coarse-grained locks.

References:

Acceptance Criteria:

  1. Implement a Lock Manager class that supports acquiring and releasing locks with read and write permissions.
  2. Integrate deadlock detection and resolution within the Lock Manager.
  3. Provide unit tests demonstrating the correct functionality of the Lock Manager, including scenarios for deadlock detection and handling.
kevinjplee commented 3 years ago

Can I work on this pattern? Thanks!

iluwatar commented 3 years ago

Please take only one issue at a time. You are already assigned for https://github.com/iluwatar/java-design-patterns/issues/1295

BillyJaffray commented 2 years ago

Can I work on this issue? Thanks!

iluwatar commented 2 years ago

Ok @BillyJaffray

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.