Best programming approach/methodology to assure thread safety

前端 未结 15 1695
一整个雨季
一整个雨季 2021-01-31 06:28

When I was learning Java coming from a background of some 20 years of procedural programming with basic, Pascal, COBOL and C, I thought at the time that the hardest thing about

15条回答
  •  佛祖请我去吃肉
    2021-01-31 07:16

    It is clearly a difficult problem. Apart from the obvious need for carefulness, I believe that the very first step is to define precisely what threads you need and why.

    Design threads as you would design classes : making sure you know what makes them consistent : their contents and their interactions with other threads.

提交回复
热议问题