Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by xmcqdpt2

5 hours ago

Does this avoid the dining philosopher deadlock?

1 comment

xmcqdpt2

Reply

gpderetta  5 hours ago

yes, 'synchronize' uses a try_lock/backoff algorithm, same as std::scoped_lock.

edit: it could theoretically livelock, but I believe most if not all STM implementations also do not guarantee forward progress.

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities