mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-10-16 16:15:45 +00:00
docs: add diagrams for lazy loading, leader election, leader followers, lockable object
This commit is contained in:
1 parent
d8b07ac484
commit
72eeb167c5
8 files changed
+16
-8
No files matched your search
@@ -29,6 +29,10 @@ In plain words
|
||||
|
||||
> Select one server in the cluster as a leader. The leader is responsible for taking decisions on behalf of the entire cluster and propagating the decisions to all the other servers.
|
||||
|
||||
Sequence diagram
|
||||
|
||||

|
||||
|
||||
## Programmatic Example of Leader-Followers Pattern in Java
|
||||
|
||||
The Leader-Followers pattern is a concurrency design pattern where one thread (the leader) waits for work to arrive, de-multiplexes, dispatches, and processes the work, thereby enhancing CPU cache affinity and reducing event dispatching latency. Once the leader finishes processing the work, it promotes one of the follower threads to be the new leader. This pattern is useful for enhancing CPU cache affinity, minimizing locking overhead, and reducing event dispatching latency.
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 69 KiB |
Reference in new issue
Block a user