Ways to Find a Race Condition

后端 未结 8 1130
无人共我
无人共我 2021-02-05 07:02

I have a bit of code with a race condition in it... I know that it is a race condition because it does not happen consistently, and it seems to happen more often on dual core ma

8条回答
  •  鱼传尺愫
    2021-02-05 07:31

    Put sleeps in various parts of your code. Something that is threadsafe will be threadsafe even if it (or asynchronous code) sleeps for even seconds.

提交回复
热议问题