Dead end in single-threaded application

Can a single-threaded application have a dead end? If yes, provide an example.

+4
source share
4 answers

Yes, a single-threaded application can come to a standstill if you have locks that are not repeaters, and the thread tries to restore the lock that it already owns (for example, through a recursive call).

Edit : I see that the message has been marked as "Java"; I don’t know if this update was or if I missed it earlier, but in any case it blocks Java ARE re-entry, so you can not slow down a single-threaded application in this way.

+6
source

, . , , . .

- , , , , .

, .

:

, 1971 . . .

  • : ,
  • : , , .
  • : , ,
  • : , ,

.

+5

, , .

+5

1 1. .

Thread lock1 → → lock1 → wait == self-deadlock. , .

0

Source: https://habr.com/ru/post/1730541/


All Articles