我应该如何对线程代码进行单元测试? - How should I unit test threaded code?

问题:

I have thus far avoided the nightmare that is testing multi-threaded code since it just seems like too much of a minefield. 到目前为止,我彷佛避免了测试多线程代码的噩梦,由于它彷佛太多了。 I'd like to ask how people have gone about testing code that relies on threads for successful execution, or just how people have gone about testing those kinds of issues that only show up when two threads interact in a given manner? 我想问一下人们如何去测试依赖于线程的代码才能成功执行,或者人们如何去测试那些仅在两个线程以给定方式交互时才会出现的问题? 程序员

This seems like a really key problem for programmers today, it would be useful to pool our knowledge on this one imho. 对于当今的程序员来讲,这彷佛是一个很是关键的问题,将咱们的知识集中在这一恕我直言中将颇有用。 多线程


解决方案:

参考一: https://stackoom.com/question/3A7/我应该如何对线程代码进行单元测试
参考二: https://oldbug.net/q/3A7/How-should-I-unit-test-threaded-code
相关文章
相关标签/搜索