SlideShare a Scribd company logo
1 of 38
Speculative Locking:
Breaking the Scale Barrier
Gil Tene, VP Technology, CTO
Ivan Posva, Senior Staff Engineer
Azul Systems
© 2005 Azul Systems, Inc. | Confidential
Multi-threaded Java Apps can Scale
www.azulsystems.com

New JVM capabilities improve
multi-threaded application scalability.
How can this affect the way you code?
Speculative locking reduces effects of Amdahl's law

2

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Agenda
www.azulsystems.com

Why do we care?
Lock contention vs. Data contention
Transactional synchronized {…}
Measurements
Effects on how you code
Summary

3

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Why do we care?
Multithreaded everywhere
www.azulsystems.com

• Java™ Applications naturally multi-threaded
─ Thread pools, work queues, shared Collections

• Multi-core CPUs from all major vendors
─ 2 or more cores per chip
─ 2 or more threads per core
─ A commodity 4 chip server will soon have 16 threads
─ Heavily multicore/multithreaded chips are here

• Amdahl’s law affects everyone
─ Serialized portions of program limit scale

4

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Amdahl’s Law
Serialized portions of program limit scale
www.azulsystems.com

• efficiency = 1/(N*q + (1-q))
─ N = # of concurrent threads
─ q = fraction of serialized code

1.0
fraction of
serialized code
0.10%
0.50%
1.00%
2.00%
5.00%
20.00%

efficiency

0.8
0.6
0.4
0.2
0.0
1
5

11

21

31

41

51

61

71

81

91

processors (N)
©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Amdahl’s Law Effect on Throughput
www.azulsystems.com

100
0.10%
0.50%
1.00%
2.00%
5.00%
20.00%
ideal

throughput scale factor

90
80
70
60
50
40
30
20
10
0
1

6

11

21

31

41
51
61
processors

71

81

91

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Amdahl’s Law Example
www.azulsystems.com

• The theoretical limit is usually intuitive
─ Assume 10% serialization
─ At best you can do 10x the work of 1 CPU

• Efficiency drops are dramatic and may be less intuitive
─
─
─
─
─
─
─

7

Assume 10% Serialization
10 CPUs will not scale past a speedup of 5.3x
(Eff. 0.53)
16 CPUs will not scale past a speedup of 6.4x
(Eff. 0.48)
64 CPUs will not scale past a speedup of 8.8x
(Eff. 0.14)
99 CPUs will not scale past a speedup of 9.2x
(Eff. 0.09)
…
It will take a whole lot of inefficient CPUs to [never] reach a 10x

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Agenda
www.azulsystems.com

Why do we care?
Lock contention vs. Data contention
Transactional synchronized {…}
Measurements
Effects on how you code
Summary

8

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Lock Contention vs. Data Contention
www.azulsystems.com

• Lock contention:
An attempt by one thread to acquire a lock
when another thread is holding it

• Data contention:
An attempt by one thread to atomically access
data when another thread expects to
manipulate the same data atomically

9

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Data Contention in a
Shared Data Structure
www.azulsystems.com

• Readers do not contend
• Readers and writers don’t always contend
• Even writers may not contend with other
writers

10

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Synchronization and Locking
Locks are typically very conservative
www.azulsystems.com

• Need synchronization for correct execution
─ Critical sections, shared data structures

• Intent is to protect against data contention
• Can’t easily tell in advance
─ That’s why we lock…

• Lock contention >= Data contention
─ In reality: lock contention >>= Data contention
11

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Database Transactions
The industry has already solved a similar problem
www.azulsystems.com

• Semantics of potential failure exposed to the
application

• Transactions: atomic group of DB commands
─ All or nothing
─ From “BEGIN TRANSACTION” to “COMMIT”

• Data contention results in a rollback
─ Leaves no trace

• Application can re-execute until successful
• Optimistic concurrency does scale
12

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Agenda
www.azulsystems.com

Why do we care?
Lock contention vs. Data contention
Transactional synchronized {…}
Measurements
Effects on how you code
Summary

13

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
www.azulsystems.com

There is no spoon.
What does synchronized mean?
www.azulsystems.com

• It does not actually mean:
grab lock, execute block, release lock

• It does mean:
execute block atomically in relation to other blocks
synchronizing on the same object

• It can be satisfied by the more conservative:
execute block atomically in relation to all other threads

• That looks a lot like a transaction
“The Java Language Specification”, “The Java Virtual Machine Specification”, JSR133
15

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Transactional synchronized {…}
www.azulsystems.com

• Two basic requirements
─ Detect data contention within the block
─ Roll back synchronized block on data contention

• synchronized can run concurrently
─ Azul uses hardware assist to detect data contention
─ Azul VM rolls back synchronized blocks that

encounter data contention

16

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Transactional synchronized {…}
www.azulsystems.com

• The Azul VM maintains the semantic meaning of:
execute block atomically in relation to all other threads

• Uncontended synchronized blocks
run just as fast as before

• Data contended synchronized blocks
still serialize execution

• synchronized blocks without data contention
can execute in parallel

17

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Transactional synchronized {…}
It’s all transparent
www.azulsystems.com

• No changes to Java code
─ The VM handles everything

• Nested synchronized blocks
─ Roll back to outermost transactional synchronized

• Reduces serialization
• Amdahl’s Law now only reflects data contention
─ Desire to reduce data contention

18

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Implementation in a VM
How does it fit in the current locking schemes?
www.azulsystems.com

• Thin locks handle uncontended synchronized blocks
─ Most common case
─ Uses CAS, no OS interaction

• Thick locks handle data contended synchronized blocks
─ Blocks in the OS

• Transactional monitors handle contended synchronized
blocks that have no data contention
─ Execute synchronized blocks in parallel
─ Uses HW support

19

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Agenda
www.azulsystems.com

Why do we care?
Lock contention vs. Data contention
Transactional synchronized {…}
Measurements
Effects on how you code
Summary

20

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Data Contention and Hashtables
www.azulsystems.com

• Examples of no data contention in a Hashtable
─ 2 readers
─ 1 reader, 1 writer, different hash buckets
─ 2 writers, different hash buckets

• Examples of data contention in a Hashtable
─ 1 reader, 1 writer in same hash bucket
─ 2 writers in same hash bucket

21

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Measurements: Hashtable (0% writes)
www.azulsystems.com

100000

Locking
Spec. Locking

10000
1000
100
10

22

Th
re
ad
s
12
8
Th
re
ad
s

64

Th
re
ad
s

32

Th
re
ad
s

16

Th
re
ad
s
8

4

Th
re
ad
s

1

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Measurements: Hashtable (5% writes)
www.azulsystems.com

100000

Locking
Spec. Locking

10000
1000
100
10

23

Th
re
ad
s
12
8
Th
re
ad
s

64

Th
re
ad
s

32

Th
re
ad
s

16

Th
re
ad
s
8

4

Th
re
ad
s

1

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Agenda
www.azulsystems.com

Why do we care?
Lock contention vs. Data contention
Transactional synchronized {…}
Measurements
Effects on how you code
Summary

24

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Coding Techniques
How to make use of this new reality?
www.azulsystems.com

• Use coarse grain synchronization
─ Simpler data structures, simpler code
─ Simplicity equals stability
─ Easier to optimize

• Focus on data contention, not on lock contention
• Reduce unavoidable data contention
• wait() and notify() can become the dominant
reason for serialized execution

─ Stripe queues and other uses of wait()/notify()

25

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Why Coarse Grain Synchronization?
www.azulsystems.com

• You can spend effort to reduce lock contention
─
─
─
─
─

Reader/writer lock
Stripe locks per bucket
Stripe reader/writer locks per bucket
How do you grow the table?
Gets complex fast

• But there is no lock, it’s a synchronized block
• With transactional synchronized
─ Keep synchronization coarse
─ Focus on data contention

26

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Minimizing Data Contention 1
www.azulsystems.com

private Object table[];
private int
size;
public synchronized void put(Object key, Object val) {
…
// missed, insert into table
table[idx] = new HashEntry(key, val, table[idx]);
size++; // writer data contention
}
public synchronized int size() {
return size;
}

27

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Minimizing Data Contention 2
www.azulsystems.com

private Object table[];
private int
sizes[];
public synchronized void put(Object key, Object val) {
…
// missed, insert into table
table[idx] = new HashEntry(key, val, table[idx]);
sizes[idx]++; // reduced writer data contention
}
public synchronized int size() {
int size = 0;
for (int i=0; i<sizes.length; i++) size += sizes[i];
return size;
}

28

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Minimizing Data Contention 3
www.azulsystems.com

private Object table[];
private int
sizes[];
private int cachedSize;
public synchronized void put(Object key, Object val) {
…
// missed, insert into table
table[idx] = new HashEntry(key, val, table[idx]);
sizes[idx]++;
cachedSize = -1; // clear the cache
}
public synchronized int size() {
if (cachedSize < 0) { // reduce size recalculation
cachedSize = 0;
for (int i=0; i<sizes.length; i++)
cachedSize += sizes[i];
}
return cachedSize;
}
29

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Minimizing Data Contention 4
www.azulsystems.com

private Object table[];
private int
sizes[];
private int cachedSize;
public synchronized void put(Object key, Object val) {
…
// missed, insert into table
table[idx] = new HashEntry(key, val, table[idx]);
sizes[idx]++;
if (cachedSize >= 0) cachedSize = -1; // avoid contention
}
public synchronized int size() {
if (cachedSize < 0) {
cachedSize = 0;
for (int i=0; i<sizes.length; i++)
cachedSize += sizes[i];
}
return cachedSize;
}
30

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Double Checked Locking Avoided
Singleton pattern
www.azulsystems.com

• Needs to be synchronized at initialization
─ Further synchronization seems to be a waste
─ Web is full of examples of how wrong you can go

• Transactional synchronized keeps it simple
public class Simple {
private Helper helper = null;
public synchronized Helper getHelper() {
if (helper == null) {
helper = new Helper();
}
return helper; // no data contention once initialized
}
// other functions and members
…
}
http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html
31

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Unavoidable Data Contention
www.azulsystems.com

Accounts
public synchronized void deposit(long amount) {
balance += amount;
}

Points
public synchronized void translate(int dx, int dy) {
x += dx;
y += dy;
}

32

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
wait()/notify()
Example: striping work queues
www.azulsystems.com

• Stripe work across multiple queues
Task task = new WorkTask(…);
Queue queue = queues[task.hashCode() % queues.length];
synchronized (queue) {
queue.enqueue(task);
queue.notify();
}

• Workers can be statically assigned to a queue
synchronized (queues) {
queue = queues[num_workers++ % queues.length];
}

33

while (true){
synchronized (queue) {
queue.wait();
Task task = queue.dequeue();
}
task.execute();
} Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
©2005
Agenda
www.azulsystems.com

Why do we care?
Lock contention vs. Data contention
Transactional synchronized {…}
Measurements
Effects on how you code
Summary

34

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Summary
www.azulsystems.com

• Transparent transactional synchronized() is available
• Simplify data structures, save development time
─ Use coarse grain locking
─ Let the VM deal with the scaling problem

• Further optimization
─ Be aware of data contention
─ Stripe stats gathering
─ Stripe wait() and notify()

35

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Our Lawyers made us say this…
www.azulsystems.com

"Azul Systems, Azul, and the Azul arch logo are trademarks of Azul
Systems, Inc. in the United States and other countries. Sun, Sun
Microsystems, Java and all Java based trademarks and logos are
trademarks or registered trademarks of Sun Microsystems, Inc. in the
United States and other countries. Other marks are the property of their
respective owners and are used here only for identification purposes."

36

©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
Q&A
© 2005 Azul Systems, Inc. | Confidential
Thank you.
gil@azulsystems.com
ivan@azulsystems.com
© 2005 Azul Systems, Inc. | Confidential

More Related Content

What's hot

NGENSTOR_ODA_P2V_V5
NGENSTOR_ODA_P2V_V5NGENSTOR_ODA_P2V_V5
NGENSTOR_ODA_P2V_V5UniFabric
 
Vertica 7.0 Architecture Overview
Vertica 7.0 Architecture OverviewVertica 7.0 Architecture Overview
Vertica 7.0 Architecture OverviewAndrey Karpov
 
Linux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performanceLinux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performancePostgreSQL-Consulting
 
10 things, an Oracle DBA should care about when moving to PostgreSQL
10 things, an Oracle DBA should care about when moving to PostgreSQL10 things, an Oracle DBA should care about when moving to PostgreSQL
10 things, an Oracle DBA should care about when moving to PostgreSQLPostgreSQL-Consulting
 
MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014Ryusuke Kajiyama
 
Exadata Deployment Bare Metal vs Virtualized
Exadata Deployment Bare Metal vs VirtualizedExadata Deployment Bare Metal vs Virtualized
Exadata Deployment Bare Metal vs VirtualizedUmair Mansoob
 
Overview of Postgres Utility Processes
Overview of Postgres Utility ProcessesOverview of Postgres Utility Processes
Overview of Postgres Utility ProcessesEDB
 
Veeam backup Oracle DB in a VM is easy and reliable way to protect data
Veeam backup Oracle DB in a VM is easy and reliable way to protect dataVeeam backup Oracle DB in a VM is easy and reliable way to protect data
Veeam backup Oracle DB in a VM is easy and reliable way to protect dataAleks Y
 
Master master vs master-slave database
Master master vs master-slave databaseMaster master vs master-slave database
Master master vs master-slave databaseWipro
 
PostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version PGConf.US 2017 by Ilya KosmodemianskyPostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version PGConf.US 2017 by Ilya KosmodemianskyPostgreSQL-Consulting
 
Built-in Replication in PostgreSQL
Built-in Replication in PostgreSQLBuilt-in Replication in PostgreSQL
Built-in Replication in PostgreSQLMasao Fujii
 
Run MongoDB with Confidence: Backing up and Monitoring with MMS
Run MongoDB with Confidence: Backing up and Monitoring with MMSRun MongoDB with Confidence: Backing up and Monitoring with MMS
Run MongoDB with Confidence: Backing up and Monitoring with MMSMongoDB
 
My experience with embedding PostgreSQL
 My experience with embedding PostgreSQL My experience with embedding PostgreSQL
My experience with embedding PostgreSQLJignesh Shah
 
Deep Dive into RDS PostgreSQL Universe
Deep Dive into RDS PostgreSQL UniverseDeep Dive into RDS PostgreSQL Universe
Deep Dive into RDS PostgreSQL UniverseJignesh Shah
 
Hardware planning & sizing for sql server
Hardware planning & sizing for sql serverHardware planning & sizing for sql server
Hardware planning & sizing for sql serverDavide Mauri
 
PostgreSQL Hangout Parameter Tuning
PostgreSQL Hangout Parameter TuningPostgreSQL Hangout Parameter Tuning
PostgreSQL Hangout Parameter TuningAshnikbiz
 
Problems with PostgreSQL on Multi-core Systems with MultiTerabyte Data
Problems with PostgreSQL on Multi-core Systems with MultiTerabyte DataProblems with PostgreSQL on Multi-core Systems with MultiTerabyte Data
Problems with PostgreSQL on Multi-core Systems with MultiTerabyte DataJignesh Shah
 
Tuning DB2 in a Solaris Environment
Tuning DB2 in a Solaris EnvironmentTuning DB2 in a Solaris Environment
Tuning DB2 in a Solaris EnvironmentJignesh Shah
 

What's hot (20)

NGENSTOR_ODA_P2V_V5
NGENSTOR_ODA_P2V_V5NGENSTOR_ODA_P2V_V5
NGENSTOR_ODA_P2V_V5
 
Vertica 7.0 Architecture Overview
Vertica 7.0 Architecture OverviewVertica 7.0 Architecture Overview
Vertica 7.0 Architecture Overview
 
Linux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performanceLinux tuning to improve PostgreSQL performance
Linux tuning to improve PostgreSQL performance
 
10 things, an Oracle DBA should care about when moving to PostgreSQL
10 things, an Oracle DBA should care about when moving to PostgreSQL10 things, an Oracle DBA should care about when moving to PostgreSQL
10 things, an Oracle DBA should care about when moving to PostgreSQL
 
MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014MySQL Performance Tuning at COSCUP 2014
MySQL Performance Tuning at COSCUP 2014
 
Exadata Deployment Bare Metal vs Virtualized
Exadata Deployment Bare Metal vs VirtualizedExadata Deployment Bare Metal vs Virtualized
Exadata Deployment Bare Metal vs Virtualized
 
Overview of Postgres Utility Processes
Overview of Postgres Utility ProcessesOverview of Postgres Utility Processes
Overview of Postgres Utility Processes
 
Veeam backup Oracle DB in a VM is easy and reliable way to protect data
Veeam backup Oracle DB in a VM is easy and reliable way to protect dataVeeam backup Oracle DB in a VM is easy and reliable way to protect data
Veeam backup Oracle DB in a VM is easy and reliable way to protect data
 
Master master vs master-slave database
Master master vs master-slave databaseMaster master vs master-slave database
Master master vs master-slave database
 
PostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version PGConf.US 2017 by Ilya KosmodemianskyPostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
PostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
 
Built-in Replication in PostgreSQL
Built-in Replication in PostgreSQLBuilt-in Replication in PostgreSQL
Built-in Replication in PostgreSQL
 
Five steps perform_2013
Five steps perform_2013Five steps perform_2013
Five steps perform_2013
 
Run MongoDB with Confidence: Backing up and Monitoring with MMS
Run MongoDB with Confidence: Backing up and Monitoring with MMSRun MongoDB with Confidence: Backing up and Monitoring with MMS
Run MongoDB with Confidence: Backing up and Monitoring with MMS
 
My experience with embedding PostgreSQL
 My experience with embedding PostgreSQL My experience with embedding PostgreSQL
My experience with embedding PostgreSQL
 
Deep Dive into RDS PostgreSQL Universe
Deep Dive into RDS PostgreSQL UniverseDeep Dive into RDS PostgreSQL Universe
Deep Dive into RDS PostgreSQL Universe
 
Hardware planning & sizing for sql server
Hardware planning & sizing for sql serverHardware planning & sizing for sql server
Hardware planning & sizing for sql server
 
Planning for Disaster Recovery (DR) with Galera Cluster
Planning for Disaster Recovery (DR) with Galera ClusterPlanning for Disaster Recovery (DR) with Galera Cluster
Planning for Disaster Recovery (DR) with Galera Cluster
 
PostgreSQL Hangout Parameter Tuning
PostgreSQL Hangout Parameter TuningPostgreSQL Hangout Parameter Tuning
PostgreSQL Hangout Parameter Tuning
 
Problems with PostgreSQL on Multi-core Systems with MultiTerabyte Data
Problems with PostgreSQL on Multi-core Systems with MultiTerabyte DataProblems with PostgreSQL on Multi-core Systems with MultiTerabyte Data
Problems with PostgreSQL on Multi-core Systems with MultiTerabyte Data
 
Tuning DB2 in a Solaris Environment
Tuning DB2 in a Solaris EnvironmentTuning DB2 in a Solaris Environment
Tuning DB2 in a Solaris Environment
 

Viewers also liked

Webinar: Zing Vision: Answering your toughest production Java performance que...
Webinar: Zing Vision: Answering your toughest production Java performance que...Webinar: Zing Vision: Answering your toughest production Java performance que...
Webinar: Zing Vision: Answering your toughest production Java performance que...Azul Systems Inc.
 
What's New in the JVM in Java 8?
What's New in the JVM in Java 8?What's New in the JVM in Java 8?
What's New in the JVM in Java 8?Azul Systems Inc.
 
How NOT to Write a Microbenchmark
How NOT to Write a MicrobenchmarkHow NOT to Write a Microbenchmark
How NOT to Write a MicrobenchmarkAzul Systems Inc.
 
Experiences with Debugging Data Races
Experiences with Debugging Data RacesExperiences with Debugging Data Races
Experiences with Debugging Data RacesAzul Systems Inc.
 
Towards a Scalable Non-Blocking Coding Style
Towards a Scalable Non-Blocking Coding StyleTowards a Scalable Non-Blocking Coding Style
Towards a Scalable Non-Blocking Coding StyleAzul Systems Inc.
 
ObjectLayout: Closing the (last?) inherent C vs. Java speed gap
ObjectLayout: Closing the (last?) inherent C vs. Java speed gapObjectLayout: Closing the (last?) inherent C vs. Java speed gap
ObjectLayout: Closing the (last?) inherent C vs. Java speed gapAzul Systems Inc.
 
Priming Java for Speed at Market Open
Priming Java for Speed at Market OpenPriming Java for Speed at Market Open
Priming Java for Speed at Market OpenAzul Systems Inc.
 
The Java Evolution Mismatch - Why You Need a Better JVM
The Java Evolution Mismatch - Why You Need a Better JVMThe Java Evolution Mismatch - Why You Need a Better JVM
The Java Evolution Mismatch - Why You Need a Better JVMAzul Systems Inc.
 
Start Fast and Stay Fast - Priming Java for Market Open with ReadyNow!
Start Fast and Stay Fast - Priming Java for Market Open with ReadyNow!Start Fast and Stay Fast - Priming Java for Market Open with ReadyNow!
Start Fast and Stay Fast - Priming Java for Market Open with ReadyNow!Azul Systems Inc.
 
Lock-Free, Wait-Free Hash Table
Lock-Free, Wait-Free Hash TableLock-Free, Wait-Free Hash Table
Lock-Free, Wait-Free Hash TableAzul Systems Inc.
 
DotCMS Bootcamp: Enabling Java in Latency Sensitivie Environments
DotCMS Bootcamp: Enabling Java in Latency Sensitivie EnvironmentsDotCMS Bootcamp: Enabling Java in Latency Sensitivie Environments
DotCMS Bootcamp: Enabling Java in Latency Sensitivie EnvironmentsAzul Systems Inc.
 
Zulu Embedded Java Introduction
Zulu Embedded Java IntroductionZulu Embedded Java Introduction
Zulu Embedded Java IntroductionAzul Systems Inc.
 

Viewers also liked (15)

Webinar: Zing Vision: Answering your toughest production Java performance que...
Webinar: Zing Vision: Answering your toughest production Java performance que...Webinar: Zing Vision: Answering your toughest production Java performance que...
Webinar: Zing Vision: Answering your toughest production Java performance que...
 
What's New in the JVM in Java 8?
What's New in the JVM in Java 8?What's New in the JVM in Java 8?
What's New in the JVM in Java 8?
 
How NOT to Write a Microbenchmark
How NOT to Write a MicrobenchmarkHow NOT to Write a Microbenchmark
How NOT to Write a Microbenchmark
 
Experiences with Debugging Data Races
Experiences with Debugging Data RacesExperiences with Debugging Data Races
Experiences with Debugging Data Races
 
Towards a Scalable Non-Blocking Coding Style
Towards a Scalable Non-Blocking Coding StyleTowards a Scalable Non-Blocking Coding Style
Towards a Scalable Non-Blocking Coding Style
 
ObjectLayout: Closing the (last?) inherent C vs. Java speed gap
ObjectLayout: Closing the (last?) inherent C vs. Java speed gapObjectLayout: Closing the (last?) inherent C vs. Java speed gap
ObjectLayout: Closing the (last?) inherent C vs. Java speed gap
 
Priming Java for Speed at Market Open
Priming Java for Speed at Market OpenPriming Java for Speed at Market Open
Priming Java for Speed at Market Open
 
The Java Evolution Mismatch - Why You Need a Better JVM
The Java Evolution Mismatch - Why You Need a Better JVMThe Java Evolution Mismatch - Why You Need a Better JVM
The Java Evolution Mismatch - Why You Need a Better JVM
 
Start Fast and Stay Fast - Priming Java for Market Open with ReadyNow!
Start Fast and Stay Fast - Priming Java for Market Open with ReadyNow!Start Fast and Stay Fast - Priming Java for Market Open with ReadyNow!
Start Fast and Stay Fast - Priming Java for Market Open with ReadyNow!
 
Lock-Free, Wait-Free Hash Table
Lock-Free, Wait-Free Hash TableLock-Free, Wait-Free Hash Table
Lock-Free, Wait-Free Hash Table
 
DotCMS Bootcamp: Enabling Java in Latency Sensitivie Environments
DotCMS Bootcamp: Enabling Java in Latency Sensitivie EnvironmentsDotCMS Bootcamp: Enabling Java in Latency Sensitivie Environments
DotCMS Bootcamp: Enabling Java in Latency Sensitivie Environments
 
What's Inside a JVM?
What's Inside a JVM?What's Inside a JVM?
What's Inside a JVM?
 
Zulu Embedded Java Introduction
Zulu Embedded Java IntroductionZulu Embedded Java Introduction
Zulu Embedded Java Introduction
 
Java vs. C/C++
Java vs. C/C++Java vs. C/C++
Java vs. C/C++
 
C++vs java
C++vs javaC++vs java
C++vs java
 

Similar to Speculative Locking: Breaking the Scale Barrier (JAOO 2005)

Understanding Hardware Transactional Memory
Understanding Hardware Transactional MemoryUnderstanding Hardware Transactional Memory
Understanding Hardware Transactional MemoryC4Media
 
Ohio Linux Fest -- MySQL's NoSQL
Ohio Linux Fest -- MySQL's NoSQLOhio Linux Fest -- MySQL's NoSQL
Ohio Linux Fest -- MySQL's NoSQLDave Stokes
 
OSMC 2015: The Assimilation Project by Alan Robertson
OSMC 2015: The Assimilation Project by Alan RobertsonOSMC 2015: The Assimilation Project by Alan Robertson
OSMC 2015: The Assimilation Project by Alan RobertsonNETWAYS
 
OSMC 2015 | The Assimilation Project by Alan Robertson
OSMC 2015 | The Assimilation Project by Alan Robertson OSMC 2015 | The Assimilation Project by Alan Robertson
OSMC 2015 | The Assimilation Project by Alan Robertson NETWAYS
 
MySQL's NoSQL -- Texas Linuxfest August 22nd 2015
MySQL's NoSQL  -- Texas Linuxfest August 22nd 2015MySQL's NoSQL  -- Texas Linuxfest August 22nd 2015
MySQL's NoSQL -- Texas Linuxfest August 22nd 2015Dave Stokes
 
Notes from #OOW19
Notes from #OOW19Notes from #OOW19
Notes from #OOW19Biju Thomas
 
Chaos Engineering with Gremlin Platform
Chaos Engineering with Gremlin PlatformChaos Engineering with Gremlin Platform
Chaos Engineering with Gremlin PlatformAnshul Patel
 
Webinar: Cloud Data Masking - Tips to Test Software Securely
Webinar: Cloud Data Masking - Tips to Test Software Securely Webinar: Cloud Data Masking - Tips to Test Software Securely
Webinar: Cloud Data Masking - Tips to Test Software Securely Skytap Cloud
 
Design for Scale / Surge 2010
Design for Scale / Surge 2010Design for Scale / Surge 2010
Design for Scale / Surge 2010Christopher Brown
 
Securing Servers in Public and Hybrid Clouds
Securing Servers in Public and Hybrid CloudsSecuring Servers in Public and Hybrid Clouds
Securing Servers in Public and Hybrid CloudsRightScale
 
Big Data on Cloud Native Platform
Big Data on Cloud Native PlatformBig Data on Cloud Native Platform
Big Data on Cloud Native PlatformSunil Govindan
 
Big Data on Cloud Native Platform
Big Data on Cloud Native PlatformBig Data on Cloud Native Platform
Big Data on Cloud Native PlatformSunil Govindan
 
Performance tuning Grails applications SpringOne 2GX 2014
Performance tuning Grails applications SpringOne 2GX 2014Performance tuning Grails applications SpringOne 2GX 2014
Performance tuning Grails applications SpringOne 2GX 2014Lari Hotari
 
Scaling Systems: Architectures that grow
Scaling Systems: Architectures that growScaling Systems: Architectures that grow
Scaling Systems: Architectures that growGibraltar Software
 
Lynn cisco IOS Exploit Presentation
Lynn cisco IOS Exploit PresentationLynn cisco IOS Exploit Presentation
Lynn cisco IOS Exploit Presentationnomorebugs
 

Similar to Speculative Locking: Breaking the Scale Barrier (JAOO 2005) (20)

Understanding Hardware Transactional Memory
Understanding Hardware Transactional MemoryUnderstanding Hardware Transactional Memory
Understanding Hardware Transactional Memory
 
Ohio Linux Fest -- MySQL's NoSQL
Ohio Linux Fest -- MySQL's NoSQLOhio Linux Fest -- MySQL's NoSQL
Ohio Linux Fest -- MySQL's NoSQL
 
OSMC 2015: The Assimilation Project by Alan Robertson
OSMC 2015: The Assimilation Project by Alan RobertsonOSMC 2015: The Assimilation Project by Alan Robertson
OSMC 2015: The Assimilation Project by Alan Robertson
 
OSMC 2015 | The Assimilation Project by Alan Robertson
OSMC 2015 | The Assimilation Project by Alan Robertson OSMC 2015 | The Assimilation Project by Alan Robertson
OSMC 2015 | The Assimilation Project by Alan Robertson
 
MySQL's NoSQL -- Texas Linuxfest August 22nd 2015
MySQL's NoSQL  -- Texas Linuxfest August 22nd 2015MySQL's NoSQL  -- Texas Linuxfest August 22nd 2015
MySQL's NoSQL -- Texas Linuxfest August 22nd 2015
 
Notes from #OOW19
Notes from #OOW19Notes from #OOW19
Notes from #OOW19
 
Chaos Engineering with Gremlin Platform
Chaos Engineering with Gremlin PlatformChaos Engineering with Gremlin Platform
Chaos Engineering with Gremlin Platform
 
Webinar: Cloud Data Masking - Tips to Test Software Securely
Webinar: Cloud Data Masking - Tips to Test Software Securely Webinar: Cloud Data Masking - Tips to Test Software Securely
Webinar: Cloud Data Masking - Tips to Test Software Securely
 
Running Galera Cluster on Microsoft Azure
Running Galera Cluster on Microsoft AzureRunning Galera Cluster on Microsoft Azure
Running Galera Cluster on Microsoft Azure
 
How to Design for High Availability & Scale with AWS
How to Design for High Availability & Scale with AWSHow to Design for High Availability & Scale with AWS
How to Design for High Availability & Scale with AWS
 
Design for Scale / Surge 2010
Design for Scale / Surge 2010Design for Scale / Surge 2010
Design for Scale / Surge 2010
 
Securing Servers in Public and Hybrid Clouds
Securing Servers in Public and Hybrid CloudsSecuring Servers in Public and Hybrid Clouds
Securing Servers in Public and Hybrid Clouds
 
Big Data on Cloud Native Platform
Big Data on Cloud Native PlatformBig Data on Cloud Native Platform
Big Data on Cloud Native Platform
 
Big Data on Cloud Native Platform
Big Data on Cloud Native PlatformBig Data on Cloud Native Platform
Big Data on Cloud Native Platform
 
Performance tuning Grails applications SpringOne 2GX 2014
Performance tuning Grails applications SpringOne 2GX 2014Performance tuning Grails applications SpringOne 2GX 2014
Performance tuning Grails applications SpringOne 2GX 2014
 
Scaling Systems: Architectures that grow
Scaling Systems: Architectures that growScaling Systems: Architectures that grow
Scaling Systems: Architectures that grow
 
Vue d'ensemble Dremio
Vue d'ensemble DremioVue d'ensemble Dremio
Vue d'ensemble Dremio
 
Lynn cisco IOS Exploit Presentation
Lynn cisco IOS Exploit PresentationLynn cisco IOS Exploit Presentation
Lynn cisco IOS Exploit Presentation
 
Apex day 1.0 oracle cloud news_andrej valach
Apex day 1.0 oracle cloud news_andrej valachApex day 1.0 oracle cloud news_andrej valach
Apex day 1.0 oracle cloud news_andrej valach
 
Preparing for Multi-Cloud
Preparing for Multi-CloudPreparing for Multi-Cloud
Preparing for Multi-Cloud
 

More from Azul Systems Inc.

Advancements ingc andc4overview_linkedin_oct2017
Advancements ingc andc4overview_linkedin_oct2017Advancements ingc andc4overview_linkedin_oct2017
Advancements ingc andc4overview_linkedin_oct2017Azul Systems Inc.
 
Understanding GC, JavaOne 2017
Understanding GC, JavaOne 2017Understanding GC, JavaOne 2017
Understanding GC, JavaOne 2017Azul Systems Inc.
 
Azul Systems open source guide
Azul Systems open source guideAzul Systems open source guide
Azul Systems open source guideAzul Systems Inc.
 
Intelligent Trading Summit NY 2014: Understanding Latency: Key Lessons and Tools
Intelligent Trading Summit NY 2014: Understanding Latency: Key Lessons and ToolsIntelligent Trading Summit NY 2014: Understanding Latency: Key Lessons and Tools
Intelligent Trading Summit NY 2014: Understanding Latency: Key Lessons and ToolsAzul Systems Inc.
 
Understanding Java Garbage Collection
Understanding Java Garbage CollectionUnderstanding Java Garbage Collection
Understanding Java Garbage CollectionAzul Systems Inc.
 
The evolution of OpenJDK: From Java's beginnings to 2014
The evolution of OpenJDK: From Java's beginnings to 2014The evolution of OpenJDK: From Java's beginnings to 2014
The evolution of OpenJDK: From Java's beginnings to 2014Azul Systems Inc.
 
Push Technology's latest data distribution benchmark with Solarflare and Zing
Push Technology's latest data distribution benchmark with Solarflare and ZingPush Technology's latest data distribution benchmark with Solarflare and Zing
Push Technology's latest data distribution benchmark with Solarflare and ZingAzul Systems Inc.
 
The Art of Java Benchmarking
The Art of Java BenchmarkingThe Art of Java Benchmarking
The Art of Java BenchmarkingAzul Systems Inc.
 
Azul Zulu on Azure Overview -- OpenTech CEE Workshop, Warsaw, Poland
Azul Zulu on Azure Overview -- OpenTech CEE Workshop, Warsaw, PolandAzul Zulu on Azure Overview -- OpenTech CEE Workshop, Warsaw, Poland
Azul Zulu on Azure Overview -- OpenTech CEE Workshop, Warsaw, PolandAzul Systems Inc.
 
Understanding Application Hiccups - and What You Can Do About Them
Understanding Application Hiccups - and What You Can Do About ThemUnderstanding Application Hiccups - and What You Can Do About Them
Understanding Application Hiccups - and What You Can Do About ThemAzul Systems Inc.
 
JVM Memory Management Details
JVM Memory Management DetailsJVM Memory Management Details
JVM Memory Management DetailsAzul Systems Inc.
 
JVM Mechanics: A Peek Under the Hood
JVM Mechanics: A Peek Under the HoodJVM Mechanics: A Peek Under the Hood
JVM Mechanics: A Peek Under the HoodAzul Systems Inc.
 
Enterprise Search Summit - Speeding Up Search
Enterprise Search Summit - Speeding Up SearchEnterprise Search Summit - Speeding Up Search
Enterprise Search Summit - Speeding Up SearchAzul Systems Inc.
 
Understanding Java Garbage Collection - And What You Can Do About It
Understanding Java Garbage Collection - And What You Can Do About ItUnderstanding Java Garbage Collection - And What You Can Do About It
Understanding Java Garbage Collection - And What You Can Do About ItAzul Systems Inc.
 
Enabling Java in Latency-Sensitive Applications
Enabling Java in Latency-Sensitive ApplicationsEnabling Java in Latency-Sensitive Applications
Enabling Java in Latency-Sensitive ApplicationsAzul Systems Inc.
 
Java at Scale, Dallas JUG, October 2013
Java at Scale, Dallas JUG, October 2013Java at Scale, Dallas JUG, October 2013
Java at Scale, Dallas JUG, October 2013Azul Systems Inc.
 

More from Azul Systems Inc. (16)

Advancements ingc andc4overview_linkedin_oct2017
Advancements ingc andc4overview_linkedin_oct2017Advancements ingc andc4overview_linkedin_oct2017
Advancements ingc andc4overview_linkedin_oct2017
 
Understanding GC, JavaOne 2017
Understanding GC, JavaOne 2017Understanding GC, JavaOne 2017
Understanding GC, JavaOne 2017
 
Azul Systems open source guide
Azul Systems open source guideAzul Systems open source guide
Azul Systems open source guide
 
Intelligent Trading Summit NY 2014: Understanding Latency: Key Lessons and Tools
Intelligent Trading Summit NY 2014: Understanding Latency: Key Lessons and ToolsIntelligent Trading Summit NY 2014: Understanding Latency: Key Lessons and Tools
Intelligent Trading Summit NY 2014: Understanding Latency: Key Lessons and Tools
 
Understanding Java Garbage Collection
Understanding Java Garbage CollectionUnderstanding Java Garbage Collection
Understanding Java Garbage Collection
 
The evolution of OpenJDK: From Java's beginnings to 2014
The evolution of OpenJDK: From Java's beginnings to 2014The evolution of OpenJDK: From Java's beginnings to 2014
The evolution of OpenJDK: From Java's beginnings to 2014
 
Push Technology's latest data distribution benchmark with Solarflare and Zing
Push Technology's latest data distribution benchmark with Solarflare and ZingPush Technology's latest data distribution benchmark with Solarflare and Zing
Push Technology's latest data distribution benchmark with Solarflare and Zing
 
The Art of Java Benchmarking
The Art of Java BenchmarkingThe Art of Java Benchmarking
The Art of Java Benchmarking
 
Azul Zulu on Azure Overview -- OpenTech CEE Workshop, Warsaw, Poland
Azul Zulu on Azure Overview -- OpenTech CEE Workshop, Warsaw, PolandAzul Zulu on Azure Overview -- OpenTech CEE Workshop, Warsaw, Poland
Azul Zulu on Azure Overview -- OpenTech CEE Workshop, Warsaw, Poland
 
Understanding Application Hiccups - and What You Can Do About Them
Understanding Application Hiccups - and What You Can Do About ThemUnderstanding Application Hiccups - and What You Can Do About Them
Understanding Application Hiccups - and What You Can Do About Them
 
JVM Memory Management Details
JVM Memory Management DetailsJVM Memory Management Details
JVM Memory Management Details
 
JVM Mechanics: A Peek Under the Hood
JVM Mechanics: A Peek Under the HoodJVM Mechanics: A Peek Under the Hood
JVM Mechanics: A Peek Under the Hood
 
Enterprise Search Summit - Speeding Up Search
Enterprise Search Summit - Speeding Up SearchEnterprise Search Summit - Speeding Up Search
Enterprise Search Summit - Speeding Up Search
 
Understanding Java Garbage Collection - And What You Can Do About It
Understanding Java Garbage Collection - And What You Can Do About ItUnderstanding Java Garbage Collection - And What You Can Do About It
Understanding Java Garbage Collection - And What You Can Do About It
 
Enabling Java in Latency-Sensitive Applications
Enabling Java in Latency-Sensitive ApplicationsEnabling Java in Latency-Sensitive Applications
Enabling Java in Latency-Sensitive Applications
 
Java at Scale, Dallas JUG, October 2013
Java at Scale, Dallas JUG, October 2013Java at Scale, Dallas JUG, October 2013
Java at Scale, Dallas JUG, October 2013
 

Recently uploaded

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 

Recently uploaded (20)

Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 

Speculative Locking: Breaking the Scale Barrier (JAOO 2005)

  • 1. Speculative Locking: Breaking the Scale Barrier Gil Tene, VP Technology, CTO Ivan Posva, Senior Staff Engineer Azul Systems © 2005 Azul Systems, Inc. | Confidential
  • 2. Multi-threaded Java Apps can Scale www.azulsystems.com New JVM capabilities improve multi-threaded application scalability. How can this affect the way you code? Speculative locking reduces effects of Amdahl's law 2 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 3. Agenda www.azulsystems.com Why do we care? Lock contention vs. Data contention Transactional synchronized {…} Measurements Effects on how you code Summary 3 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 4. Why do we care? Multithreaded everywhere www.azulsystems.com • Java™ Applications naturally multi-threaded ─ Thread pools, work queues, shared Collections • Multi-core CPUs from all major vendors ─ 2 or more cores per chip ─ 2 or more threads per core ─ A commodity 4 chip server will soon have 16 threads ─ Heavily multicore/multithreaded chips are here • Amdahl’s law affects everyone ─ Serialized portions of program limit scale 4 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 5. Amdahl’s Law Serialized portions of program limit scale www.azulsystems.com • efficiency = 1/(N*q + (1-q)) ─ N = # of concurrent threads ─ q = fraction of serialized code 1.0 fraction of serialized code 0.10% 0.50% 1.00% 2.00% 5.00% 20.00% efficiency 0.8 0.6 0.4 0.2 0.0 1 5 11 21 31 41 51 61 71 81 91 processors (N) ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 6. Amdahl’s Law Effect on Throughput www.azulsystems.com 100 0.10% 0.50% 1.00% 2.00% 5.00% 20.00% ideal throughput scale factor 90 80 70 60 50 40 30 20 10 0 1 6 11 21 31 41 51 61 processors 71 81 91 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 7. Amdahl’s Law Example www.azulsystems.com • The theoretical limit is usually intuitive ─ Assume 10% serialization ─ At best you can do 10x the work of 1 CPU • Efficiency drops are dramatic and may be less intuitive ─ ─ ─ ─ ─ ─ ─ 7 Assume 10% Serialization 10 CPUs will not scale past a speedup of 5.3x (Eff. 0.53) 16 CPUs will not scale past a speedup of 6.4x (Eff. 0.48) 64 CPUs will not scale past a speedup of 8.8x (Eff. 0.14) 99 CPUs will not scale past a speedup of 9.2x (Eff. 0.09) … It will take a whole lot of inefficient CPUs to [never] reach a 10x ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 8. Agenda www.azulsystems.com Why do we care? Lock contention vs. Data contention Transactional synchronized {…} Measurements Effects on how you code Summary 8 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 9. Lock Contention vs. Data Contention www.azulsystems.com • Lock contention: An attempt by one thread to acquire a lock when another thread is holding it • Data contention: An attempt by one thread to atomically access data when another thread expects to manipulate the same data atomically 9 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 10. Data Contention in a Shared Data Structure www.azulsystems.com • Readers do not contend • Readers and writers don’t always contend • Even writers may not contend with other writers 10 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 11. Synchronization and Locking Locks are typically very conservative www.azulsystems.com • Need synchronization for correct execution ─ Critical sections, shared data structures • Intent is to protect against data contention • Can’t easily tell in advance ─ That’s why we lock… • Lock contention >= Data contention ─ In reality: lock contention >>= Data contention 11 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 12. Database Transactions The industry has already solved a similar problem www.azulsystems.com • Semantics of potential failure exposed to the application • Transactions: atomic group of DB commands ─ All or nothing ─ From “BEGIN TRANSACTION” to “COMMIT” • Data contention results in a rollback ─ Leaves no trace • Application can re-execute until successful • Optimistic concurrency does scale 12 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 13. Agenda www.azulsystems.com Why do we care? Lock contention vs. Data contention Transactional synchronized {…} Measurements Effects on how you code Summary 13 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 15. What does synchronized mean? www.azulsystems.com • It does not actually mean: grab lock, execute block, release lock • It does mean: execute block atomically in relation to other blocks synchronizing on the same object • It can be satisfied by the more conservative: execute block atomically in relation to all other threads • That looks a lot like a transaction “The Java Language Specification”, “The Java Virtual Machine Specification”, JSR133 15 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 16. Transactional synchronized {…} www.azulsystems.com • Two basic requirements ─ Detect data contention within the block ─ Roll back synchronized block on data contention • synchronized can run concurrently ─ Azul uses hardware assist to detect data contention ─ Azul VM rolls back synchronized blocks that encounter data contention 16 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 17. Transactional synchronized {…} www.azulsystems.com • The Azul VM maintains the semantic meaning of: execute block atomically in relation to all other threads • Uncontended synchronized blocks run just as fast as before • Data contended synchronized blocks still serialize execution • synchronized blocks without data contention can execute in parallel 17 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 18. Transactional synchronized {…} It’s all transparent www.azulsystems.com • No changes to Java code ─ The VM handles everything • Nested synchronized blocks ─ Roll back to outermost transactional synchronized • Reduces serialization • Amdahl’s Law now only reflects data contention ─ Desire to reduce data contention 18 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 19. Implementation in a VM How does it fit in the current locking schemes? www.azulsystems.com • Thin locks handle uncontended synchronized blocks ─ Most common case ─ Uses CAS, no OS interaction • Thick locks handle data contended synchronized blocks ─ Blocks in the OS • Transactional monitors handle contended synchronized blocks that have no data contention ─ Execute synchronized blocks in parallel ─ Uses HW support 19 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 20. Agenda www.azulsystems.com Why do we care? Lock contention vs. Data contention Transactional synchronized {…} Measurements Effects on how you code Summary 20 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 21. Data Contention and Hashtables www.azulsystems.com • Examples of no data contention in a Hashtable ─ 2 readers ─ 1 reader, 1 writer, different hash buckets ─ 2 writers, different hash buckets • Examples of data contention in a Hashtable ─ 1 reader, 1 writer in same hash bucket ─ 2 writers in same hash bucket 21 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 22. Measurements: Hashtable (0% writes) www.azulsystems.com 100000 Locking Spec. Locking 10000 1000 100 10 22 Th re ad s 12 8 Th re ad s 64 Th re ad s 32 Th re ad s 16 Th re ad s 8 4 Th re ad s 1 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 23. Measurements: Hashtable (5% writes) www.azulsystems.com 100000 Locking Spec. Locking 10000 1000 100 10 23 Th re ad s 12 8 Th re ad s 64 Th re ad s 32 Th re ad s 16 Th re ad s 8 4 Th re ad s 1 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 24. Agenda www.azulsystems.com Why do we care? Lock contention vs. Data contention Transactional synchronized {…} Measurements Effects on how you code Summary 24 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 25. Coding Techniques How to make use of this new reality? www.azulsystems.com • Use coarse grain synchronization ─ Simpler data structures, simpler code ─ Simplicity equals stability ─ Easier to optimize • Focus on data contention, not on lock contention • Reduce unavoidable data contention • wait() and notify() can become the dominant reason for serialized execution ─ Stripe queues and other uses of wait()/notify() 25 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 26. Why Coarse Grain Synchronization? www.azulsystems.com • You can spend effort to reduce lock contention ─ ─ ─ ─ ─ Reader/writer lock Stripe locks per bucket Stripe reader/writer locks per bucket How do you grow the table? Gets complex fast • But there is no lock, it’s a synchronized block • With transactional synchronized ─ Keep synchronization coarse ─ Focus on data contention 26 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 27. Minimizing Data Contention 1 www.azulsystems.com private Object table[]; private int size; public synchronized void put(Object key, Object val) { … // missed, insert into table table[idx] = new HashEntry(key, val, table[idx]); size++; // writer data contention } public synchronized int size() { return size; } 27 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 28. Minimizing Data Contention 2 www.azulsystems.com private Object table[]; private int sizes[]; public synchronized void put(Object key, Object val) { … // missed, insert into table table[idx] = new HashEntry(key, val, table[idx]); sizes[idx]++; // reduced writer data contention } public synchronized int size() { int size = 0; for (int i=0; i<sizes.length; i++) size += sizes[i]; return size; } 28 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 29. Minimizing Data Contention 3 www.azulsystems.com private Object table[]; private int sizes[]; private int cachedSize; public synchronized void put(Object key, Object val) { … // missed, insert into table table[idx] = new HashEntry(key, val, table[idx]); sizes[idx]++; cachedSize = -1; // clear the cache } public synchronized int size() { if (cachedSize < 0) { // reduce size recalculation cachedSize = 0; for (int i=0; i<sizes.length; i++) cachedSize += sizes[i]; } return cachedSize; } 29 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 30. Minimizing Data Contention 4 www.azulsystems.com private Object table[]; private int sizes[]; private int cachedSize; public synchronized void put(Object key, Object val) { … // missed, insert into table table[idx] = new HashEntry(key, val, table[idx]); sizes[idx]++; if (cachedSize >= 0) cachedSize = -1; // avoid contention } public synchronized int size() { if (cachedSize < 0) { cachedSize = 0; for (int i=0; i<sizes.length; i++) cachedSize += sizes[i]; } return cachedSize; } 30 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 31. Double Checked Locking Avoided Singleton pattern www.azulsystems.com • Needs to be synchronized at initialization ─ Further synchronization seems to be a waste ─ Web is full of examples of how wrong you can go • Transactional synchronized keeps it simple public class Simple { private Helper helper = null; public synchronized Helper getHelper() { if (helper == null) { helper = new Helper(); } return helper; // no data contention once initialized } // other functions and members … } http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html 31 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 32. Unavoidable Data Contention www.azulsystems.com Accounts public synchronized void deposit(long amount) { balance += amount; } Points public synchronized void translate(int dx, int dy) { x += dx; y += dy; } 32 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 33. wait()/notify() Example: striping work queues www.azulsystems.com • Stripe work across multiple queues Task task = new WorkTask(…); Queue queue = queues[task.hashCode() % queues.length]; synchronized (queue) { queue.enqueue(task); queue.notify(); } • Workers can be statically assigned to a queue synchronized (queues) { queue = queues[num_workers++ % queues.length]; } 33 while (true){ synchronized (queue) { queue.wait(); Task task = queue.dequeue(); } task.execute(); } Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems. ©2005
  • 34. Agenda www.azulsystems.com Why do we care? Lock contention vs. Data contention Transactional synchronized {…} Measurements Effects on how you code Summary 34 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 35. Summary www.azulsystems.com • Transparent transactional synchronized() is available • Simplify data structures, save development time ─ Use coarse grain locking ─ Let the VM deal with the scaling problem • Further optimization ─ Be aware of data contention ─ Stripe stats gathering ─ Stripe wait() and notify() 35 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 36. Our Lawyers made us say this… www.azulsystems.com "Azul Systems, Azul, and the Azul arch logo are trademarks of Azul Systems, Inc. in the United States and other countries. Sun, Sun Microsystems, Java and all Java based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. Other marks are the property of their respective owners and are used here only for identification purposes." 36 ©2005 Azul Systems, Inc. Strictly Confidential. Do not distribute or share any of this information without specific approval from Azul Systems.
  • 37. Q&A © 2005 Azul Systems, Inc. | Confidential

Editor's Notes

  1. Reader/writer locks are an attempt at solving this but they do not solve this completely because they do not distinguish different buckets usually.
  2. In summary, we have discussed the CIO Challenges, the emerging category of BTO and Mercury Interactive’s new BTO solution suite. Let’s discuss how customers get started and see results through BTO. Unlike the mega projects of the last decade, BTO solutions are not monoliths that require tens of millions of dollars, several years of implementation and still present an uncertain outcome. BTO is incremental and immediate – focusing first on improving what the customer has “today”. In 3-6 weeks customers can see improvements in their existing environments.  
  3. Talking points: HW is conservative, can detect false collision without data contention.
  4. Reader/writer locks are an attempt at solving this but they do not solve this completely because they do not distinguish different buckets usually.
  5. Hashtable size: 100 entries
  6. Same Hashtable as before, now with some collisions.
  7. Make size() cheap and reduce the window of potential data contention inside size().
  8. For the Accounts example one could argue the use of concurrent.Atomics, since this only updates a single variable. Whereas a Point cannot be updated with one atomic operation.