Is it possible for a thread to Deadlock itself?

后端 未结 20 1324
暗喜
暗喜 2020-12-02 09:29

Is it technically possible for a thread in Java to deadlock itself?

I was asked this at an interview a while back and responded that it wasn\'t possible but the inte

20条回答
  •  -上瘾入骨i
    2020-12-02 09:52

    According to Wikipedia, "A deadlock is a situation wherein two or more competing actions are each waiting for the other to finish, and thus neither ever does."

    ..."In computer science, Coffman deadlock refers to a specific condition when two or more processes are each waiting for each other to release a resource, or more than two processes are waiting for resources in a circular chain."

    I think two or more are key words here if you stay strict to definition.

提交回复
热议问题