Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 112941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:37:26+00:00 2026-05-11T02:37:26+00:00

In Release It! , Michael Nygard reasons that many catastrophic system failures are often

  • 0

In Release It!, Michael Nygard reasons that many catastrophic system failures are often caused by a chain of things going wrong. For example, two threads deadlock. There’s now two less threads in the thread pool, so load increases on the other threads increasing their likelihood of deadlocks. Suddenly, the server does not respond at all, because the thread pool is exhausted, which causes the load balancer to divert traffic to the other servers (who are all running the same code), which increases their likelihood of deadlocks. Suddenly the whole farm is offline.

Most RDBMS servers detect deadlocks and decide a ‘loser’ (one transaction is aborted, the other can continue). By contrast, in C#, the lock statement will wait indefinitely for a lock to be acquired.

You can however call Monitor.TryEnter(lockObject, TimeSpan) to request a lock or timeout. It returns false if the timeout expires and the lock could not be acquired. Some have wrapped this in using statements to keep a nice syntax.

So my question is, do you always acquire locks using timeouts, or not? And what issues do timeouts create versus a deadlock scenario?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T02:37:27+00:00Added an answer on May 11, 2026 at 2:37 am

    I normally do use timeouts. The biggest issue here is that if the timeout is reached, the requesting operation is going to be aborted. This is obviously preferrable to deadlocking. There’s a bigger problem there though: if the operation is critical and you start aborting because something else is deadlocked, if your design is not sound, you could end up causing the farm-going-down issue you described via this method (though softer: your app will no longer work, but you haven’t lost control).

    The main difference is that you actually have control here, whereas if threads start deadlocking, there’s nothing you can do within your code to fix the problem once the failure has started.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The release notes for Java NIO (in Java 1.4+) state that support for direct
Occasionally you meet bugs that are reproducible only in release builds and/or only on
The release notes of Grails 2.0 mention that it has removed Prototype in favour
I use maven release plugin. In my pom exists and Ant task that automatically
I tried today to switch our release build so that it uses branches. Before
'mvn release:perform' takes too long to deploy artifacts to Archiva. The logs shows that
In release notes of CouchDB 0.11 is stated, that it supports readers fields. I
I want to release an update to my ad hoc build that exists on
I am nearing the release of an iOS app that syncs and otherwise interacts
The release notes say: Django 1.3 adds framework-level support for Python’s logging module. That's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.