Using TDD to drive out thread-safe code

前端 未结 6 1639
清酒与你
清酒与你 2020-12-13 22:26

What\'s a good way to leverage TDD to drive out thread-safe code? For example, say I have a factory method that utilizes lazy initialization to create only one instance of

6条回答
  •  悲哀的现实
    2020-12-13 23:04

    Chapter 12 of Java Concurrency in Practice is called "Testing Concurrent Programs". It documents testing for safety and liveness, but says this is a hard subject. I am not sure this problem is solvable by the tools of that chapter.

提交回复
热议问题