SlideShare a Scribd company logo
1 of 33
Download to read offline
2007 JavaOne Conference

A Lock-Free Hash Table

Debugging Data Races

Dr. Cliff Click
Chief JVM Architect & Distinguished Engineer
blogs.azulsystems.com/cliff
Azul Systems
May 8, 2007
A Short Debugging Tale
www.azulsystems.com

if (method.hasCode() != true )
return false;
code = method.getCode();
...setup;
code.execute(); // Throws NPE rarely!!!
return true;

• Example is real; simplified for slide
─ Many more wrapper layers removed
─ Shown “as if” aggressive inlining

• I've debugged dozens of slight variations
|

©2007 Azul Systems, Inc.
Hash Tables
www.azulsystems.com

•
•
•
•

Constant-Time Key-Value Mapping
Fast arbitrary function
Extendable, defined at runtime
Used for symbol tables, DB caching, network
access, url caching, web content, etc
• Crucial for Large Business Applications
─ > 1MLOC
• Used in Very heavily multi-threaded apps
─ > 1000 threads
|

©2007 Azul Systems, Inc.
Agenda
www.azulsystems.com

•
•
•
•
•

|

(not very) Formal Stuff
Reordering Memory – A peek under the hood
Common Data Races
Finally(!) Some Debugging Techniques
Summary

©2007 Azul Systems, Inc.
What IS a Data Race?
www.azulsystems.com

• Formally:
─ Two threads accessing the same memory
─ At least one is writing
─ And no language-level ordering

• Informally:

─ Broken attempt to use more CPUs
─ (but can happen with 1 CPU)

• Generally because 1 CPU is too slow
─ End of frequency scaling

:-(
• Multi-core, dual-socket, big server, etc
|

©2007 Azul Systems, Inc.
Timeline of a Data Race
www.azulsystems.com

T1

T2
flush_old_cache

r1 = _code
if( !r1 ) ...
_code = null
r1 = _code
call exec(r1)

|

©2007 Azul Systems, Inc.

• Two threads
Timeline of a Data Race
www.azulsystems.com

T1

T2
flush_old_cache

r1 = _code
if( !r1 ) ...
_code = null
r1 = _code
call exec(r1)

|

©2007 Azul Systems, Inc.

• Two threads
• Accessing same memory
Timeline of a Data Race
www.azulsystems.com

T1

T2
flush_old_cache

r1 = _code
if( !r1 ) ...
_code = null
r1 = _code
call exec(r1)

|

©2007 Azul Systems, Inc.

• Two threads
• Accessing same memory
• At least one is writing
Timeline of a Data Race
www.azulsystems.com

T1

T2
flush_old_cache

r1 = _code
if( !r1 ) ...
_code = null
r1 = _code
call exec(r1)

|

©2007 Azul Systems, Inc.

•
•
•
•

Two threads
Accessing same memory
At least one is writing
No language-level
ordering
Timeline of a Data Race
www.azulsystems.com

T1

T2
flush_old_cache

r1 = _code
if( !r1 ) ...
_code = null
r1 = _code
call exec(r1)

|

©2007 Azul Systems, Inc.

• OK if:
─ Write before 1st Read OR
─ Write after 2nd Read

• Broken if in-between
• Pot-Luck based on OS

thread schedule
• Crash rarely in testing
• More context switches
under heavy load
• Crash routine in production
Agenda
www.azulsystems.com

•
•
•
•
•

|

(not very) Formal Stuff
Reordering Memory – A peek under the hood
Common Data Races
Finally(!) Some Debugging Techniques
Summary

©2007 Azul Systems, Inc.
Reordering Memory Ops
www.azulsystems.com

T1

T2

_datum = stuff
_flag = true
r1 = _flag
if( !r1 ) ...
r2 = _datum

|

©2007 Azul Systems, Inc.

• Writing 2 fields
• Can T2 see stale _datum?
• Yes!
Reordering Memory Ops
www.azulsystems.com

T1

T2

r2 = _datum
_datum = stuff

•
•
•
•

Writing 2 fields
Can T2 see stale _datum?
Yes!
Compiler can reorder
─ Standard faire for -O

_flag = true
r1 = _flag
if( !r1 ) ...

• Java: make _flag volatile
• C/C++: dicier
─ no C memory model yet

|

©2007 Azul Systems, Inc.
Reordering Memory Ops
www.azulsystems.com

T1

T2
r1 = _flag
if( !r1 ) ... // predict
r2 = _datum

_datum = stuff
_flag = true
...r1 true
...so keep r2

•
•
•
•
•
•
•

Writing 2 fields
Can T2 see stale _datum?
Yes!
Hardware can reorder
Load _flag misses cache
Predict r1==true
Speculatively load _datum
early, hits cache

• _flag comes back true
• Keep speculative _datum
|

©2007 Azul Systems, Inc.
Reordering Memory Ops
www.azulsystems.com

T1

T2

_datum = stuff
membar st-st
_flag = true
r1 = _flag
if( !r1 ) ...
membar ld-ld
r2 = _datum

|

©2007 Azul Systems, Inc.

•
•
•
•
•
•

Writing 2 fields
Can T2 see stale _datum?
No!
Need store-side ordering
Need load-side ordering
Included in Java volatile
Reordering Memory Ops
www.azulsystems.com

T1

T2
r1 = _flag
if( !r1 ) ... // predict
r2 = _datum

_datum = stuff
membar st-st
_flag = true
...r1 true
...so keep r2

|

©2007 Azul Systems, Inc.

•
•
•
•
•
•
•
•

Writing 2 fields
Can T2 see stale _datum?
Yes!
Missing load-ordering
Read of _flag misses
Predict branch
Fetch _datum early
Confirm good branch
Reordering Memory Ops
www.azulsystems.com

T1

T2

_datum = stuff
_flag = true
r1 = _flag
if( !r1 ) ...
membar ld-ld
r2 = _datum
...stuff actually
...visible

|

©2007 Azul Systems, Inc.

•
•
•
•
•
•
•
•

Writing 2 fields
Can T2 see stale _datum?
Yes!
Missing store ordering
Write of _datum misses
Write of _flag hits cache
T2 reads _flag
T2 reads stale _datum
Agenda
www.azulsystems.com

•
•
•
•
•

|

(not very) Formal Stuff
Reordering Memory – A peek under the hood
Common Data Races
Finally(!) Some Debugging Techniques
Summary

©2007 Azul Systems, Inc.
Common Data Races
www.azulsystems.com

• My experiences only
• Double-read with write in the middle:
if( _p != null )
... _p._fld...

_p = null;

• ...and it's usually a null write
• Two writes with reads in the middle:
_size++;
_array=new[_size];

• Double Checked Locking:
|

©2007 Azul Systems, Inc.

..._array[_size-1]...
if( _global == null )
synchronized(x)
if( _global == null )
_global = new;
Double Checked Locking
www.azulsystems.com

T1

T2

r1 = new
_global = r1
r1 = _global
if( !r1 ) ...
r2 = r1._fld
r1._fld = stuff
membar st-st

•
•
•
•
•

Initializing global singleton
Can T2 see stale _fld?
Yes!
Misplaced store-ordering
Unlock puts barrier AFTER
both writes
─ Not between

• Actually missing loadordering as well

─ True data dependency
─ Only IA64 might reorder?

|

©2007 Azul Systems, Inc.
More On Double-Read
www.azulsystems.com

• if( _p != null ) ..._p._fld...

• Compiler likes to CSE together

─ C: Crashes in debug, not product
─ Java: Crashes before high-opt JIT kicks in

•
•
•
•

|

Crashes when context-switch between reads
i.e., just as heavy load hits system
If you survive startup, might last a long time
Bug can persist for years
─ Plenty of personal experience here...

©2007 Azul Systems, Inc.
Getting Clever w/HashMap
www.azulsystems.com

• Using a collection unsafely, and catching NPE
─ But not catching rarer AIOOB
─ Bit a customer AND in-house engineer

• Idea: HashMap w/single writer, many readers
─ No locking needed since 1 writer
─ Readers sometimes see ½ of 'put'
─ Throw NPE occasionally; catch & retry

• Writer is mid-resize, reader hashes to larger table
─ But does lookup on smaller table, Bang!

• Reader calls size(), size() calls resize, Bang!
|

©2007 Azul Systems, Inc.
Agenda
www.azulsystems.com

•
•
•
•
•

|

(not very) Formal Stuff
Reordering Memory – A peek under the hood
Common Data Races
Finally(!) Some Debugging Techniques
Summary

©2007 Azul Systems, Inc.
Visual Inspection
www.azulsystems.com

•
•
•
•
•

Easy to get started with
Works on core files; after the fact
Very slow per LOC
Just obtaining the code is often a problem
Sometimes can make a more directed search
─ e.g., Stack trace points out where somebody failed
─ Play mental Sherlock Holmes w/self

• Does not scale
• Requires Memory Model expert, domain expert
|

©2007 Azul Systems, Inc.
Visual Inspection
www.azulsystems.com

• Biggest Flaw: Not Knowing The Players
• Maintainer cannot name shared variables
─ Or which threads can access them
─ Or when they are allowed to touch

• Sometimes suffices to Make Access Explicit
• Avoiding Double-Read:

─ Often requires changing accessor patterns
─ Cache in a local variable
─ Return flag & value in 1 shot

|

©2007 Azul Systems, Inc.
Visual Inspection
www.azulsystems.com

•
•
•
•

2nd Biggest Flaw: forgetting “The Cycle”
Concurrent code does: {start, do, end}
Inspect: two threads both doing {start, do, end}
But code in a cycle!
─ ...start, do, end, stuff, start, do, end, stuff...
• Inspect: two threads both doing {end, stuff, start}
• Inspect: {start, do, end} vs {end, stuff, start}
─ (chasing each others' tail)

|

©2007 Azul Systems, Inc.
Printing
www.azulsystems.com

• Printing / Logging / Events
─
─
─
─
─

“Make noise” at each read/write of shared variable
Inspect trace after crash
Serialized results...
...but blocks; changes timing, hides data-race bugs
Also OS can buffer per-thread; WYSI not WYG

• Per-Thread Printing
─
─
─
─

|

Write “event tokens” (enums) to per-thread ring-buffer
No complex String creation, no object creation
Much less overhead & no blocking (ring buffer!)
Less likely to hide bug

©2007 Azul Systems, Inc.
It Takes Two to Tangle...
www.azulsystems.com

• Want: Who Dun It and When Dey Did It
• Per-Thread Printing w/TimeStamp
─ Slap a System.nanoTime in the per-thread event buffer

• Post-process the crash
─
─
─
─

Sort all ring-buffers by nanoTime
Print a time-line just before the crash
AND after the crash
99% chance the “guilty thread” stands out

• Rather heavy-weight technique
─ Need to know where to target it

|

©2007 Azul Systems, Inc.
Agenda
www.azulsystems.com

•
•
•
•
•

|

(not very) Formal Stuff
Reordering Memory – A peek under the hood
Common Data Races
Finally(!) Some Debugging Techniques
Summary

©2007 Azul Systems, Inc.
Writing Data Races
www.azulsystems.com

• Often hidden by Good Programming Practice
• Already solving a Large, Complex Problem
• Using abstraction, accessors
─ Giving meaning to memory access
─ In context of L.C.P.

• Need more speed
• So introduce Concurrency, Threads
• Patterns like Double-Checked Locking
─ Or double-read

|

©2007 Azul Systems, Inc.
The Pitfall
www.azulsystems.com

• End up adding Concurrency to L.C.P.
• Fail to recognize Concurrency as a

(subtle) Complex Problem
• Needs its own wrappers, access control
• Interviews w/Data-Race Victims:
─ Often they cannot name the shared vars
─ Don't know which thread can touch what
─ ... or when
• Fix starts with Gathering this info and
asserting Access Control over shared vars
|

©2007 Azul Systems, Inc.
Summary
www.azulsystems.com

• Other techniques
─ Formal proofs? Still not ready for prime-time
─ Although hardware designers make it work

• Statistical
─ I get X fails/month; what happens that often?

• No good answers yet
• Best answers so far:
─ Don't Get Clever w/Concurrency
─ Document, Document, Document
http://www.azulsystems.com/blogs/cliff
|

©2007 Azul Systems, Inc.
#1 Platform for
Business Critical Java™

WWW.AZULSYSTEMS.COM
Thank You

More Related Content

What's hot

Steelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trashSteelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trashinfodox
 
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.
 
Beyond JVM - YOW! Brisbane 2013
Beyond JVM - YOW! Brisbane 2013Beyond JVM - YOW! Brisbane 2013
Beyond JVM - YOW! Brisbane 2013Charles Nutter
 
Efficient Memory and Thread Management in Highly Parallel Java Applications
Efficient Memory and Thread Management in Highly Parallel Java ApplicationsEfficient Memory and Thread Management in Highly Parallel Java Applications
Efficient Memory and Thread Management in Highly Parallel Java Applicationspkoza
 
Memory Management: What You Need to Know When Moving to Java 8
Memory Management: What You Need to Know When Moving to Java 8Memory Management: What You Need to Know When Moving to Java 8
Memory Management: What You Need to Know When Moving to Java 8AppDynamics
 
Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016Charles Nutter
 
Oaktable World 2014 Toon Koppelaars: database constraints polite excuse
Oaktable World 2014 Toon Koppelaars: database constraints polite excuseOaktable World 2014 Toon Koppelaars: database constraints polite excuse
Oaktable World 2014 Toon Koppelaars: database constraints polite excuseKyle Hailey
 
Java profiling Do It Yourself (jug.msk.ru 2016)
Java profiling Do It Yourself (jug.msk.ru 2016)Java profiling Do It Yourself (jug.msk.ru 2016)
Java profiling Do It Yourself (jug.msk.ru 2016)aragozin
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuningJerry Kurian
 
High Performance Computing - Cloud Point of View
High Performance Computing - Cloud Point of ViewHigh Performance Computing - Cloud Point of View
High Performance Computing - Cloud Point of Viewaragozin
 
Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous ApplicationsJohan Edstrom
 
Ehcache 3: JSR-107 on steroids at Devoxx Morocco
Ehcache 3: JSR-107 on steroids at Devoxx MoroccoEhcache 3: JSR-107 on steroids at Devoxx Morocco
Ehcache 3: JSR-107 on steroids at Devoxx MoroccoLouis Jacomet
 
Ultimate pen test compromising a highly secure environment (nikhil)
Ultimate pen test   compromising a highly secure environment (nikhil)Ultimate pen test   compromising a highly secure environment (nikhil)
Ultimate pen test compromising a highly secure environment (nikhil)ClubHack
 
Profiling & Testing with Spark
Profiling & Testing with SparkProfiling & Testing with Spark
Profiling & Testing with SparkRoger Rafanell Mas
 
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
Service Delivery Assembly Line with Vagrant, Packer, and AnsibleService Delivery Assembly Line with Vagrant, Packer, and Ansible
Service Delivery Assembly Line with Vagrant, Packer, and AnsibleIsaac Christoffersen
 
Rackspace Hack Night - Vagrant & Packer
Rackspace Hack Night - Vagrant & PackerRackspace Hack Night - Vagrant & Packer
Rackspace Hack Night - Vagrant & PackerMarc Cluet
 
Comprehensive Terraform Training
Comprehensive Terraform TrainingComprehensive Terraform Training
Comprehensive Terraform TrainingYevgeniy Brikman
 
DotNetFest - Let’s refresh our memory! Memory management in .NET
DotNetFest - Let’s refresh our memory! Memory management in .NETDotNetFest - Let’s refresh our memory! Memory management in .NET
DotNetFest - Let’s refresh our memory! Memory management in .NETMaarten Balliauw
 
Performance Test Driven Development with Oracle Coherence
Performance Test Driven Development with Oracle CoherencePerformance Test Driven Development with Oracle Coherence
Performance Test Driven Development with Oracle Coherencearagozin
 

What's hot (20)

Steelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trashSteelcon 2015 - 0wning the internet of trash
Steelcon 2015 - 0wning the internet of trash
 
Lock-Free, Wait-Free Hash Table
Lock-Free, Wait-Free Hash TableLock-Free, Wait-Free Hash Table
Lock-Free, Wait-Free Hash Table
 
Beyond JVM - YOW! Brisbane 2013
Beyond JVM - YOW! Brisbane 2013Beyond JVM - YOW! Brisbane 2013
Beyond JVM - YOW! Brisbane 2013
 
Efficient Memory and Thread Management in Highly Parallel Java Applications
Efficient Memory and Thread Management in Highly Parallel Java ApplicationsEfficient Memory and Thread Management in Highly Parallel Java Applications
Efficient Memory and Thread Management in Highly Parallel Java Applications
 
Memory Management: What You Need to Know When Moving to Java 8
Memory Management: What You Need to Know When Moving to Java 8Memory Management: What You Need to Know When Moving to Java 8
Memory Management: What You Need to Know When Moving to Java 8
 
Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016Ruby Performance - The Last Mile - RubyConf India 2016
Ruby Performance - The Last Mile - RubyConf India 2016
 
Oaktable World 2014 Toon Koppelaars: database constraints polite excuse
Oaktable World 2014 Toon Koppelaars: database constraints polite excuseOaktable World 2014 Toon Koppelaars: database constraints polite excuse
Oaktable World 2014 Toon Koppelaars: database constraints polite excuse
 
Java profiling Do It Yourself (jug.msk.ru 2016)
Java profiling Do It Yourself (jug.msk.ru 2016)Java profiling Do It Yourself (jug.msk.ru 2016)
Java profiling Do It Yourself (jug.msk.ru 2016)
 
Java performance tuning
Java performance tuningJava performance tuning
Java performance tuning
 
High Performance Computing - Cloud Point of View
High Performance Computing - Cloud Point of ViewHigh Performance Computing - Cloud Point of View
High Performance Computing - Cloud Point of View
 
Building Asynchronous Applications
Building Asynchronous ApplicationsBuilding Asynchronous Applications
Building Asynchronous Applications
 
Ehcache 3: JSR-107 on steroids at Devoxx Morocco
Ehcache 3: JSR-107 on steroids at Devoxx MoroccoEhcache 3: JSR-107 on steroids at Devoxx Morocco
Ehcache 3: JSR-107 on steroids at Devoxx Morocco
 
Ultimate pen test compromising a highly secure environment (nikhil)
Ultimate pen test   compromising a highly secure environment (nikhil)Ultimate pen test   compromising a highly secure environment (nikhil)
Ultimate pen test compromising a highly secure environment (nikhil)
 
Profiling & Testing with Spark
Profiling & Testing with SparkProfiling & Testing with Spark
Profiling & Testing with Spark
 
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
Service Delivery Assembly Line with Vagrant, Packer, and AnsibleService Delivery Assembly Line with Vagrant, Packer, and Ansible
Service Delivery Assembly Line with Vagrant, Packer, and Ansible
 
Rackspace Hack Night - Vagrant & Packer
Rackspace Hack Night - Vagrant & PackerRackspace Hack Night - Vagrant & Packer
Rackspace Hack Night - Vagrant & Packer
 
Comprehensive Terraform Training
Comprehensive Terraform TrainingComprehensive Terraform Training
Comprehensive Terraform Training
 
DotNetFest - Let’s refresh our memory! Memory management in .NET
DotNetFest - Let’s refresh our memory! Memory management in .NETDotNetFest - Let’s refresh our memory! Memory management in .NET
DotNetFest - Let’s refresh our memory! Memory management in .NET
 
Basics of JVM Tuning
Basics of JVM TuningBasics of JVM Tuning
Basics of JVM Tuning
 
Performance Test Driven Development with Oracle Coherence
Performance Test Driven Development with Oracle CoherencePerformance Test Driven Development with Oracle Coherence
Performance Test Driven Development with Oracle Coherence
 

Viewers also liked

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.
 
Speculative Locking: Breaking the Scale Barrier (JAOO 2005)
Speculative Locking: Breaking the Scale Barrier (JAOO 2005)Speculative Locking: Breaking the Scale Barrier (JAOO 2005)
Speculative Locking: Breaking the Scale Barrier (JAOO 2005)Azul 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.
 
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.
 
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.
 
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.
 
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.
 
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 (14)

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
 
Speculative Locking: Breaking the Scale Barrier (JAOO 2005)
Speculative Locking: Breaking the Scale Barrier (JAOO 2005)Speculative Locking: Breaking the Scale Barrier (JAOO 2005)
Speculative Locking: Breaking the Scale Barrier (JAOO 2005)
 
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
 
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
 
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...
 
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
 
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!
 
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 Experiences with Debugging Data Races

Application Profiling for Memory and Performance
Application Profiling for Memory and PerformanceApplication Profiling for Memory and Performance
Application Profiling for Memory and Performancepradeepfn
 
Application Profiling for Memory and Performance
Application Profiling for Memory and PerformanceApplication Profiling for Memory and Performance
Application Profiling for Memory and PerformanceWSO2
 
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...Amazon Web Services
 
JavaOne 2010: Top 10 Causes for Java Issues in Production and What to Do When...
JavaOne 2010: Top 10 Causes for Java Issues in Production and What to Do When...JavaOne 2010: Top 10 Causes for Java Issues in Production and What to Do When...
JavaOne 2010: Top 10 Causes for Java Issues in Production and What to Do When...srisatish ambati
 
Why databases cry at night
Why databases cry at nightWhy databases cry at night
Why databases cry at nightMichael Yarichuk
 
MongoDB Use Cases: Healthcare, CMS, Analytics
MongoDB Use Cases: Healthcare, CMS, AnalyticsMongoDB Use Cases: Healthcare, CMS, Analytics
MongoDB Use Cases: Healthcare, CMS, AnalyticsMongoDB
 
Ceph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer SpotlightCeph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer SpotlightRed_Hat_Storage
 
Ceph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer SpotlightCeph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer SpotlightColleen Corrice
 
Hacklu2011 tricaud
Hacklu2011 tricaudHacklu2011 tricaud
Hacklu2011 tricaudstricaud
 
Ruby performance - The low hanging fruit
Ruby performance - The low hanging fruitRuby performance - The low hanging fruit
Ruby performance - The low hanging fruitBruce Werdschinski
 
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)Tech in Asia ID
 
Hadoop Operations: Keeping the Elephant Running Smoothly
Hadoop Operations: Keeping the Elephant Running SmoothlyHadoop Operations: Keeping the Elephant Running Smoothly
Hadoop Operations: Keeping the Elephant Running SmoothlyMichael Arnold
 
Deployment Strategies
Deployment StrategiesDeployment Strategies
Deployment StrategiesMongoDB
 
Deployment Strategy
Deployment StrategyDeployment Strategy
Deployment StrategyMongoDB
 
A New Tracer for Reverse Engineering - PacSec 2010
A New Tracer for Reverse Engineering - PacSec 2010A New Tracer for Reverse Engineering - PacSec 2010
A New Tracer for Reverse Engineering - PacSec 2010Tsukasa Oi
 
Solr on Windows: Does it Work? Does it Scale? - Teun Duynstee
Solr on Windows: Does it Work? Does it Scale? - Teun DuynsteeSolr on Windows: Does it Work? Does it Scale? - Teun Duynstee
Solr on Windows: Does it Work? Does it Scale? - Teun Duynsteelucenerevolution
 
Deployment Strategies (Mongo Austin)
Deployment Strategies (Mongo Austin)Deployment Strategies (Mongo Austin)
Deployment Strategies (Mongo Austin)MongoDB
 
Yapc10 Cdt World Domination
Yapc10   Cdt World DominationYapc10   Cdt World Domination
Yapc10 Cdt World DominationcPanel
 

Similar to Experiences with Debugging Data Races (20)

Application Profiling for Memory and Performance
Application Profiling for Memory and PerformanceApplication Profiling for Memory and Performance
Application Profiling for Memory and Performance
 
Application Profiling for Memory and Performance
Application Profiling for Memory and PerformanceApplication Profiling for Memory and Performance
Application Profiling for Memory and Performance
 
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
Accelerating Application Performance with Amazon ElastiCache (DAT207) | AWS r...
 
Surge2012
Surge2012Surge2012
Surge2012
 
rsyslog meets docker
rsyslog meets dockerrsyslog meets docker
rsyslog meets docker
 
JavaOne 2010: Top 10 Causes for Java Issues in Production and What to Do When...
JavaOne 2010: Top 10 Causes for Java Issues in Production and What to Do When...JavaOne 2010: Top 10 Causes for Java Issues in Production and What to Do When...
JavaOne 2010: Top 10 Causes for Java Issues in Production and What to Do When...
 
Why databases cry at night
Why databases cry at nightWhy databases cry at night
Why databases cry at night
 
MongoDB Use Cases: Healthcare, CMS, Analytics
MongoDB Use Cases: Healthcare, CMS, AnalyticsMongoDB Use Cases: Healthcare, CMS, Analytics
MongoDB Use Cases: Healthcare, CMS, Analytics
 
Ceph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer SpotlightCeph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer Spotlight
 
Ceph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer SpotlightCeph Deployment at Target: Customer Spotlight
Ceph Deployment at Target: Customer Spotlight
 
Hacklu2011 tricaud
Hacklu2011 tricaudHacklu2011 tricaud
Hacklu2011 tricaud
 
Ruby performance - The low hanging fruit
Ruby performance - The low hanging fruitRuby performance - The low hanging fruit
Ruby performance - The low hanging fruit
 
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
"You Don't Know NODE.JS" by Hengki Mardongan Sihombing (Urbanhire)
 
Hadoop Operations: Keeping the Elephant Running Smoothly
Hadoop Operations: Keeping the Elephant Running SmoothlyHadoop Operations: Keeping the Elephant Running Smoothly
Hadoop Operations: Keeping the Elephant Running Smoothly
 
Deployment Strategies
Deployment StrategiesDeployment Strategies
Deployment Strategies
 
Deployment Strategy
Deployment StrategyDeployment Strategy
Deployment Strategy
 
A New Tracer for Reverse Engineering - PacSec 2010
A New Tracer for Reverse Engineering - PacSec 2010A New Tracer for Reverse Engineering - PacSec 2010
A New Tracer for Reverse Engineering - PacSec 2010
 
Solr on Windows: Does it Work? Does it Scale? - Teun Duynstee
Solr on Windows: Does it Work? Does it Scale? - Teun DuynsteeSolr on Windows: Does it Work? Does it Scale? - Teun Duynstee
Solr on Windows: Does it Work? Does it Scale? - Teun Duynstee
 
Deployment Strategies (Mongo Austin)
Deployment Strategies (Mongo Austin)Deployment Strategies (Mongo Austin)
Deployment Strategies (Mongo Austin)
 
Yapc10 Cdt World Domination
Yapc10   Cdt World DominationYapc10   Cdt World Domination
Yapc10 Cdt World Domination
 

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

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 

Experiences with Debugging Data Races

  • 1. 2007 JavaOne Conference A Lock-Free Hash Table Debugging Data Races Dr. Cliff Click Chief JVM Architect & Distinguished Engineer blogs.azulsystems.com/cliff Azul Systems May 8, 2007
  • 2. A Short Debugging Tale www.azulsystems.com if (method.hasCode() != true ) return false; code = method.getCode(); ...setup; code.execute(); // Throws NPE rarely!!! return true; • Example is real; simplified for slide ─ Many more wrapper layers removed ─ Shown “as if” aggressive inlining • I've debugged dozens of slight variations | ©2007 Azul Systems, Inc.
  • 3. Hash Tables www.azulsystems.com • • • • Constant-Time Key-Value Mapping Fast arbitrary function Extendable, defined at runtime Used for symbol tables, DB caching, network access, url caching, web content, etc • Crucial for Large Business Applications ─ > 1MLOC • Used in Very heavily multi-threaded apps ─ > 1000 threads | ©2007 Azul Systems, Inc.
  • 4. Agenda www.azulsystems.com • • • • • | (not very) Formal Stuff Reordering Memory – A peek under the hood Common Data Races Finally(!) Some Debugging Techniques Summary ©2007 Azul Systems, Inc.
  • 5. What IS a Data Race? www.azulsystems.com • Formally: ─ Two threads accessing the same memory ─ At least one is writing ─ And no language-level ordering • Informally: ─ Broken attempt to use more CPUs ─ (but can happen with 1 CPU) • Generally because 1 CPU is too slow ─ End of frequency scaling :-( • Multi-core, dual-socket, big server, etc | ©2007 Azul Systems, Inc.
  • 6. Timeline of a Data Race www.azulsystems.com T1 T2 flush_old_cache r1 = _code if( !r1 ) ... _code = null r1 = _code call exec(r1) | ©2007 Azul Systems, Inc. • Two threads
  • 7. Timeline of a Data Race www.azulsystems.com T1 T2 flush_old_cache r1 = _code if( !r1 ) ... _code = null r1 = _code call exec(r1) | ©2007 Azul Systems, Inc. • Two threads • Accessing same memory
  • 8. Timeline of a Data Race www.azulsystems.com T1 T2 flush_old_cache r1 = _code if( !r1 ) ... _code = null r1 = _code call exec(r1) | ©2007 Azul Systems, Inc. • Two threads • Accessing same memory • At least one is writing
  • 9. Timeline of a Data Race www.azulsystems.com T1 T2 flush_old_cache r1 = _code if( !r1 ) ... _code = null r1 = _code call exec(r1) | ©2007 Azul Systems, Inc. • • • • Two threads Accessing same memory At least one is writing No language-level ordering
  • 10. Timeline of a Data Race www.azulsystems.com T1 T2 flush_old_cache r1 = _code if( !r1 ) ... _code = null r1 = _code call exec(r1) | ©2007 Azul Systems, Inc. • OK if: ─ Write before 1st Read OR ─ Write after 2nd Read • Broken if in-between • Pot-Luck based on OS thread schedule • Crash rarely in testing • More context switches under heavy load • Crash routine in production
  • 11. Agenda www.azulsystems.com • • • • • | (not very) Formal Stuff Reordering Memory – A peek under the hood Common Data Races Finally(!) Some Debugging Techniques Summary ©2007 Azul Systems, Inc.
  • 12. Reordering Memory Ops www.azulsystems.com T1 T2 _datum = stuff _flag = true r1 = _flag if( !r1 ) ... r2 = _datum | ©2007 Azul Systems, Inc. • Writing 2 fields • Can T2 see stale _datum? • Yes!
  • 13. Reordering Memory Ops www.azulsystems.com T1 T2 r2 = _datum _datum = stuff • • • • Writing 2 fields Can T2 see stale _datum? Yes! Compiler can reorder ─ Standard faire for -O _flag = true r1 = _flag if( !r1 ) ... • Java: make _flag volatile • C/C++: dicier ─ no C memory model yet | ©2007 Azul Systems, Inc.
  • 14. Reordering Memory Ops www.azulsystems.com T1 T2 r1 = _flag if( !r1 ) ... // predict r2 = _datum _datum = stuff _flag = true ...r1 true ...so keep r2 • • • • • • • Writing 2 fields Can T2 see stale _datum? Yes! Hardware can reorder Load _flag misses cache Predict r1==true Speculatively load _datum early, hits cache • _flag comes back true • Keep speculative _datum | ©2007 Azul Systems, Inc.
  • 15. Reordering Memory Ops www.azulsystems.com T1 T2 _datum = stuff membar st-st _flag = true r1 = _flag if( !r1 ) ... membar ld-ld r2 = _datum | ©2007 Azul Systems, Inc. • • • • • • Writing 2 fields Can T2 see stale _datum? No! Need store-side ordering Need load-side ordering Included in Java volatile
  • 16. Reordering Memory Ops www.azulsystems.com T1 T2 r1 = _flag if( !r1 ) ... // predict r2 = _datum _datum = stuff membar st-st _flag = true ...r1 true ...so keep r2 | ©2007 Azul Systems, Inc. • • • • • • • • Writing 2 fields Can T2 see stale _datum? Yes! Missing load-ordering Read of _flag misses Predict branch Fetch _datum early Confirm good branch
  • 17. Reordering Memory Ops www.azulsystems.com T1 T2 _datum = stuff _flag = true r1 = _flag if( !r1 ) ... membar ld-ld r2 = _datum ...stuff actually ...visible | ©2007 Azul Systems, Inc. • • • • • • • • Writing 2 fields Can T2 see stale _datum? Yes! Missing store ordering Write of _datum misses Write of _flag hits cache T2 reads _flag T2 reads stale _datum
  • 18. Agenda www.azulsystems.com • • • • • | (not very) Formal Stuff Reordering Memory – A peek under the hood Common Data Races Finally(!) Some Debugging Techniques Summary ©2007 Azul Systems, Inc.
  • 19. Common Data Races www.azulsystems.com • My experiences only • Double-read with write in the middle: if( _p != null ) ... _p._fld... _p = null; • ...and it's usually a null write • Two writes with reads in the middle: _size++; _array=new[_size]; • Double Checked Locking: | ©2007 Azul Systems, Inc. ..._array[_size-1]... if( _global == null ) synchronized(x) if( _global == null ) _global = new;
  • 20. Double Checked Locking www.azulsystems.com T1 T2 r1 = new _global = r1 r1 = _global if( !r1 ) ... r2 = r1._fld r1._fld = stuff membar st-st • • • • • Initializing global singleton Can T2 see stale _fld? Yes! Misplaced store-ordering Unlock puts barrier AFTER both writes ─ Not between • Actually missing loadordering as well ─ True data dependency ─ Only IA64 might reorder? | ©2007 Azul Systems, Inc.
  • 21. More On Double-Read www.azulsystems.com • if( _p != null ) ..._p._fld... • Compiler likes to CSE together ─ C: Crashes in debug, not product ─ Java: Crashes before high-opt JIT kicks in • • • • | Crashes when context-switch between reads i.e., just as heavy load hits system If you survive startup, might last a long time Bug can persist for years ─ Plenty of personal experience here... ©2007 Azul Systems, Inc.
  • 22. Getting Clever w/HashMap www.azulsystems.com • Using a collection unsafely, and catching NPE ─ But not catching rarer AIOOB ─ Bit a customer AND in-house engineer • Idea: HashMap w/single writer, many readers ─ No locking needed since 1 writer ─ Readers sometimes see ½ of 'put' ─ Throw NPE occasionally; catch & retry • Writer is mid-resize, reader hashes to larger table ─ But does lookup on smaller table, Bang! • Reader calls size(), size() calls resize, Bang! | ©2007 Azul Systems, Inc.
  • 23. Agenda www.azulsystems.com • • • • • | (not very) Formal Stuff Reordering Memory – A peek under the hood Common Data Races Finally(!) Some Debugging Techniques Summary ©2007 Azul Systems, Inc.
  • 24. Visual Inspection www.azulsystems.com • • • • • Easy to get started with Works on core files; after the fact Very slow per LOC Just obtaining the code is often a problem Sometimes can make a more directed search ─ e.g., Stack trace points out where somebody failed ─ Play mental Sherlock Holmes w/self • Does not scale • Requires Memory Model expert, domain expert | ©2007 Azul Systems, Inc.
  • 25. Visual Inspection www.azulsystems.com • Biggest Flaw: Not Knowing The Players • Maintainer cannot name shared variables ─ Or which threads can access them ─ Or when they are allowed to touch • Sometimes suffices to Make Access Explicit • Avoiding Double-Read: ─ Often requires changing accessor patterns ─ Cache in a local variable ─ Return flag & value in 1 shot | ©2007 Azul Systems, Inc.
  • 26. Visual Inspection www.azulsystems.com • • • • 2nd Biggest Flaw: forgetting “The Cycle” Concurrent code does: {start, do, end} Inspect: two threads both doing {start, do, end} But code in a cycle! ─ ...start, do, end, stuff, start, do, end, stuff... • Inspect: two threads both doing {end, stuff, start} • Inspect: {start, do, end} vs {end, stuff, start} ─ (chasing each others' tail) | ©2007 Azul Systems, Inc.
  • 27. Printing www.azulsystems.com • Printing / Logging / Events ─ ─ ─ ─ ─ “Make noise” at each read/write of shared variable Inspect trace after crash Serialized results... ...but blocks; changes timing, hides data-race bugs Also OS can buffer per-thread; WYSI not WYG • Per-Thread Printing ─ ─ ─ ─ | Write “event tokens” (enums) to per-thread ring-buffer No complex String creation, no object creation Much less overhead & no blocking (ring buffer!) Less likely to hide bug ©2007 Azul Systems, Inc.
  • 28. It Takes Two to Tangle... www.azulsystems.com • Want: Who Dun It and When Dey Did It • Per-Thread Printing w/TimeStamp ─ Slap a System.nanoTime in the per-thread event buffer • Post-process the crash ─ ─ ─ ─ Sort all ring-buffers by nanoTime Print a time-line just before the crash AND after the crash 99% chance the “guilty thread” stands out • Rather heavy-weight technique ─ Need to know where to target it | ©2007 Azul Systems, Inc.
  • 29. Agenda www.azulsystems.com • • • • • | (not very) Formal Stuff Reordering Memory – A peek under the hood Common Data Races Finally(!) Some Debugging Techniques Summary ©2007 Azul Systems, Inc.
  • 30. Writing Data Races www.azulsystems.com • Often hidden by Good Programming Practice • Already solving a Large, Complex Problem • Using abstraction, accessors ─ Giving meaning to memory access ─ In context of L.C.P. • Need more speed • So introduce Concurrency, Threads • Patterns like Double-Checked Locking ─ Or double-read | ©2007 Azul Systems, Inc.
  • 31. The Pitfall www.azulsystems.com • End up adding Concurrency to L.C.P. • Fail to recognize Concurrency as a (subtle) Complex Problem • Needs its own wrappers, access control • Interviews w/Data-Race Victims: ─ Often they cannot name the shared vars ─ Don't know which thread can touch what ─ ... or when • Fix starts with Gathering this info and asserting Access Control over shared vars | ©2007 Azul Systems, Inc.
  • 32. Summary www.azulsystems.com • Other techniques ─ Formal proofs? Still not ready for prime-time ─ Although hardware designers make it work • Statistical ─ I get X fails/month; what happens that often? • No good answers yet • Best answers so far: ─ Don't Get Clever w/Concurrency ─ Document, Document, Document http://www.azulsystems.com/blogs/cliff | ©2007 Azul Systems, Inc.
  • 33. #1 Platform for Business Critical Java™ WWW.AZULSYSTEMS.COM Thank You