diff --git a/README.md b/README.md
index 7f3ae687e..f47252648 100644
--- a/README.md
+++ b/README.md
@@ -239,7 +239,14 @@
* many distinct and unrelated operations need to be performed on objects in an object structure, and you want to avoid "polluting" their classes with these operations. Visitor lets you keep related operations together by defining them in one class. When the object structure is shared by many applications, use Visitor to put operations in just those applications that need them
* the classes defining the object structure rarely change, but you often want to define new operations over the structure. Changing the object structure classes requires redefining the interface to all visitors, which is potentially costly. If the object structure classes change often, then it's probably better to define the operations in those classes
+##Double Checked Locking
+**Intent:** Reduce the overhead of acquiring a lock by first testing the locking criterion (the "lock hint") without actually acquiring the lock. Only if the locking criterion check indicates that locking is required does the actual locking logic proceed.
+
+
+**Applicability:** Use the Double Checked Locking pattern when
+* there is a concurrent access in object creation, e.g. singleton, where you want to create single instance of the same class and checking if it's null or not maybe not be enough when there are two or more threads that checks if instance is null or not.
+* there is a concurrent access on a method where method's behaviour changes according to the some constraints and these constraint change within this method.
# Frequently asked questions
diff --git a/double-checked-locking/etc/double_checked_locking.jpeg b/double-checked-locking/etc/double_checked_locking.jpeg
new file mode 100644
index 000000000..5b219cc81
Binary files /dev/null and b/double-checked-locking/etc/double_checked_locking.jpeg differ
diff --git a/double-checked-locking/pom.xml b/double-checked-locking/pom.xml
new file mode 100644
index 000000000..4f608b70f
--- /dev/null
+++ b/double-checked-locking/pom.xml
@@ -0,0 +1,17 @@
+
+ 4.0.0
+
+ com.iluwatar
+ java-design-patterns
+ 1.0-SNAPSHOT
+
+ double-checked-locking
+
+
+ junit
+ junit
+ 3.8.1
+ test
+
+
+
diff --git a/double-checked-locking/src/main/java/com/iluwatar/App.java b/double-checked-locking/src/main/java/com/iluwatar/App.java
new file mode 100644
index 000000000..7e6bfd532
--- /dev/null
+++ b/double-checked-locking/src/main/java/com/iluwatar/App.java
@@ -0,0 +1,30 @@
+package com.iluwatar;
+
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+/**
+ *
+ * In Inventory we store the items with a given size. However,
+ * we do not store more items than the inventory size. To address
+ * concurrent access problems we use double checked locking to add
+ * item to inventory. In this method, the thread which gets the lock
+ * first adds the item.
+ */
+
+public class App
+{
+ public static void main( String[] args )
+ {
+ final Inventory inventory = new Inventory(1000);
+ ExecutorService executorService = Executors.newFixedThreadPool(3);
+ for (int i = 0; i < 3; i++) {
+ executorService.execute(new Runnable() {
+ @Override
+ public void run() {
+ while(inventory.addItem(new Item()));
+ }
+ });
+ }
+ }
+}
diff --git a/double-checked-locking/src/main/java/com/iluwatar/Inventory.java b/double-checked-locking/src/main/java/com/iluwatar/Inventory.java
new file mode 100644
index 000000000..a6ddc350d
--- /dev/null
+++ b/double-checked-locking/src/main/java/com/iluwatar/Inventory.java
@@ -0,0 +1,36 @@
+package com.iluwatar;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+
+public class Inventory {
+
+ private int inventorySize;
+ private List- items;
+ private Lock lock = new ReentrantLock();
+
+ public Inventory(int inventorySize) {
+ this.inventorySize = inventorySize;
+ this.items = new ArrayList
- (inventorySize);
+ }
+
+ public boolean addItem(Item item){
+ if(items.size()strategy
template-method
visitor
+ double-checked-locking
diff --git a/singleton/src/main/java/com/iluwatar/IvoryTower.java b/singleton/src/main/java/com/iluwatar/IvoryTower.java
index d4030cb2e..113962eb8 100644
--- a/singleton/src/main/java/com/iluwatar/IvoryTower.java
+++ b/singleton/src/main/java/com/iluwatar/IvoryTower.java
@@ -9,8 +9,7 @@ public class IvoryTower {
private static IvoryTower instance = new IvoryTower();
- private IvoryTower() {
- }
+ private IvoryTower() {}
public static IvoryTower getInstance() {
return instance;