From 6d1a13745f628b51aa90c456b564179fa7af355c Mon Sep 17 00:00:00 2001 From: Rob Austin Date: Sun, 21 Dec 2014 09:28:48 +0000 Subject: [PATCH] updates around -"acquireUsingLocked" --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 93c65032d..7bf8e3db1 100644 --- a/README.md +++ b/README.md @@ -580,10 +580,12 @@ look-ups and making your code run slightly faster. If you are only accessing ChronicleMap from a single thread. If you are not doing replication and don't care about atomic reads. Then its simpler ( and faster ) to use acquireUsing() otherwise we -recommend you use `acquireUsingLocked(key,value)` +recommend you use `acquireUsingLocked(key,value)` as this gives you atomicity. -Since the acquireUsing() method can end up creating an entry, the acquireUsingLocked(key,value) method must hold -a segment write lock, this is unlike getUsing(key,using) which only holds a segment read lock. +The acquireUsingLocked(key,value) method holds a segment write lock, as it will update or put a +new entry into the map, this is unlike getUsing +(key,using) which only holds a segment read lock. Below is an example of how to use +acquireUsingLocked(..,..). ``` java BondVOInterface bond = ... // create your instance