How should I unit test threaded code?

后端 未结 26 1908
悲&欢浪女
悲&欢浪女 2020-11-22 04:09

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 test

26条回答
  •  傲寒
    傲寒 (楼主)
    2020-11-22 04:30

    Pete Goodliffe has a series on the unit testing of threaded code.

    It's hard. I take the easier way out and try to keep the threading code abstracted from the actual test. Pete does mention that the way I do it is wrong but I've either got the separation right or I've just been lucky.

提交回复
热议问题