Thread safety object - static or not?

后端 未结 6 1981
故里飘歌
故里飘歌 2021-01-11 15:09

I was recently in an interview and the tech guy asked me about how to make an application thread-safe.

Well, after explaining the lock() correctly, he s

6条回答
  •  抹茶落季
    2021-01-11 15:31

    Sometimes in job interviews I say something I know is incorrect or something that is utter nonsense to see if the candidate will effectively argue his point or just give up and agree.

    Oh and here's an excellent article by Jeffrey Richter on the proper uses of lock. :)

提交回复
热议问题