<s>
It	O
is	O
a	O
Skip	O
list	O
which	O
uses	O
Lock-free	B-Operating_System
techniques	O
to	O
make	O
a	O
tree	O
.	O
</s>
<s>
A	O
trie-based	O
Lock-free	B-Operating_System
tree	O
.	O
</s>
<s>
Mutual	O
exclusion	O
has	O
a	O
Lock	B-Operating_System
convoy	I-Operating_System
problem	O
,	O
in	O
which	O
threads	O
may	O
pile	O
up	O
on	O
a	O
lock	O
,	O
causing	O
the	O
JVM	O
to	O
need	O
to	O
maintain	O
expensive	O
queues	O
of	O
waiters	O
and	O
to	O
'	O
park	O
 '	O
the	O
waiting	O
threads	O
.	O
</s>
<s>
The	O
implementations	O
of	O
the	O
particular	O
concurrent	O
Maps	O
provided	O
by	O
the	O
Java	B-Language
Collections	I-Language
Framework	I-Language
and	O
others	O
sometimes	O
take	O
advantage	O
of	O
multiple	O
cores	O
using	O
Lock	B-Operating_System
free	I-Operating_System
programming	O
techniques	O
.	O
</s>
<s>
Lock-free	B-Operating_System
techniques	O
use	O
operations	O
like	O
the	O
compareAndSet( )	O
intrinsic	O
method	O
available	O
on	O
many	O
of	O
the	O
Java	O
classes	O
such	O
as	O
AtomicReference	O
to	O
do	O
conditional	O
updates	O
of	O
some	O
Map-internal	O
structures	O
atomically	O
.	O
</s>
<s>
The	O
techniques	O
are	O
complex	O
,	O
relying	O
often	O
on	O
the	O
rules	O
of	O
inter-thread	O
communication	O
provided	O
by	O
volatile	O
variables	O
,	O
the	O
happens-before	O
relation	O
,	O
special	O
kinds	O
of	O
lock-free	B-Operating_System
'	O
retry	O
loops	O
 '	O
(	O
which	O
are	O
not	O
like	O
spin	O
locks	O
in	O
that	O
they	O
always	O
produce	O
progress	O
)	O
.	O
</s>
<s>
It	O
is	O
possible	O
for	O
any	O
Java	O
code	O
to	O
use	O
for	O
other	O
purposes	O
the	O
compareAndSet( )	O
method	O
on	O
various	O
concurrent	O
classes	O
to	O
achieve	O
Lock-free	B-Operating_System
or	O
even	O
Wait-free	B-Operating_System
concurrency	O
,	O
which	O
provides	O
finite	O
latency	O
.	O
</s>
<s>
Lock-free	B-Operating_System
techniques	O
are	O
simple	O
in	O
many	O
common	O
cases	O
and	O
with	O
some	O
simple	O
collections	O
like	O
stacks	O
.	O
</s>
<s>
GC	O
and	O
JVM	O
process	O
expansion	O
change	O
the	O
curves	O
considerably	O
,	O
and	O
some	O
internal	O
Lock-Free	B-Operating_System
techniques	O
generate	O
garbage	O
on	O
contention	O
.	O
</s>
<s>
The	O
default	O
implementations	O
in	O
Map	O
do	O
not	O
guarantee	O
atomicity	O
,	O
but	O
in	O
the	O
ConcurrentMap	O
overriding	O
defaults	O
these	O
use	O
Lock	B-Operating_System
free	I-Operating_System
techniques	O
to	O
achieve	O
atomicity	O
,	O
and	O
existing	O
ConcurrentMap	O
implementations	O
will	O
automatically	O
be	O
atomic	O
.	O
</s>
<s>
The	O
lock-free	B-Operating_System
techniques	O
may	O
be	O
slower	O
than	O
overrides	O
in	O
the	O
concrete	O
classes	O
,	O
so	O
concrete	O
classes	O
may	O
choose	O
to	O
implement	O
them	O
atomically	O
or	O
not	O
and	O
document	O
the	O
concurrency	O
properties	O
.	O
</s>
<s>
It	O
is	O
possible	O
to	O
use	O
Lock-free	B-Operating_System
techniques	O
with	O
ConcurrentMaps	O
because	O
they	O
include	O
methods	O
of	O
a	O
sufficiently	O
high	O
consensus	O
number	O
,	O
namely	O
infinity	O
,	O
meaning	O
that	O
any	O
number	O
of	O
threads	O
may	O
be	O
coordinated	O
.	O
</s>
<s>
This	O
example	O
could	O
be	O
implemented	O
with	O
the	O
Java	O
8	O
merge( )	O
but	O
it	O
shows	O
the	O
overall	O
Lock-free	B-Operating_System
pattern	O
,	O
which	O
is	O
more	O
general	O
.	O
</s>
<s>
This	O
example	O
could	O
be	O
implemented	O
with	O
the	O
Java	O
8	O
compute( )	O
but	O
it	O
shows	O
the	O
overall	O
Lock-free	B-Operating_System
pattern	O
,	O
which	O
is	O
more	O
general	O
.	O
</s>
<s>
The	O
Java	B-Language
collections	I-Language
framework	I-Language
was	O
designed	O
and	O
developed	O
primarily	O
by	O
Joshua	O
Bloch	O
,	O
and	O
was	O
introduced	O
in	O
JDK	O
1.2	O
.	O
</s>
