This simple code produces deadlock. Simple Example Program included

后端 未结 3 928
伪装坚强ぢ
伪装坚强ぢ 2021-01-15 17:52

Code, notice the order of the values is different. So it alternates between locking rows:

static void Main( string[] args )
        {
            List

        
3条回答
  •  悲哀的现实
    2021-01-15 18:08

    Agree with other answers as regards to the locking.

    The more pressing question is what are you hoping to gain from this? There's only one cable those commands are travelling down.

    You are probably making the overall performance worse by doing this. Far better to do your computation in parallel but serialize (and possibly batch) your updates.

提交回复
热议问题