Using TDD to drive out thread-safe code

前端 未结 6 1645
清酒与你
清酒与你 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:07

    Just off the top of my head could you compare the instances returned to see if they are indeed the same instance or if they are different? That's probably where I would start with C#, I would imagine you can do the same in java

提交回复
热议问题