Skip to content

dt/init-deadlock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project demonstrates a deadlock between threads initializing singleton objects that have a circular dependency between them. If the objects are initialized in parallel by different threads, they will deadlock. If the objects are initialized serially, no deadlock occurs.

To run this project, run sbt and type:

run-main ScalaTest parallel to run the Scala test in parallel

run-main ScalaTest serial to run the Scala test in series

run-main JavaTest to run the Java test (only runs in parallel)

Suggestions on how to catch this class of errors (at compile time, test time, or run time) are most welcome.

About

Demo of static init deadlock in scala (and java)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages