How to detect and debug multi-threading problems?

前端 未结 17 1871
陌清茗
陌清茗 2020-11-29 16:12

This is a follow up to this question, where I didn\'t get any input on this point. Here is the brief question:

Is it possible to detect and debug problems co

17条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-29 16:32

    Assuming I have reports of troubles that are hard to reproduce I always find these by reading code, preferably pair-code-reading, so you can discuss threading semantics/locking needs. When we do this based on a reported problem, I find we always nail one or more problems fairly quickly. I think it's also a fairly cheap technique to solve hard problems.

    Sorry for not being able to tell you to press ctrl+shift+f13, but I don't think there's anything like that available. But just thinking about what the reported issue actually is usually gives a fairly strong sense of direction in the code, so you don't have to start at main().

提交回复
热议问题