• gnasher729 (unregistered) in reply to zbxvc
    zbxvc:
    typical deadlock when you end up acquiring a set of locks in two threads in different order.
    There is a simple technique to detect potential deadlocks, which don't deadlock in the developers' hands, but only when a customer uses the code: Assign an order number to each lock. Then when a thread aquires a lock, it is _not_ allowed to aquire any lock with same or lower order number. When this happens, you log it as a potential deadlock. You then fix the problem: Either you are locking the locks in the wrong order, or you assigned the orderings incorrectly.
  • The Crunger (unregistered) in reply to Matt Westwood

    Matt -- I am quoting you, but this comment is really directed to the guys who don't seem to "get it".

    Matt Westwood:
    ... actually I have it on good authority that the charmer in Sales is already married and has three children (all with different women, none of which is his wife, who is built like a brick shithouse and has been known to hospitalise her rivals).

    ... On the other hand, if she is open to listening to reason, and would prefer a straight-up guy who actually knows how to fix things.

    In other words, you have stipulated that:

    (1) Multiple women are attracted to that guy (2) That guy could inflict serious violence on someone who threatens the spoiled miserable brats she might spawn to replace herself, and (3) You are boring.

    The advice to "be yourself and talk to her" is good, but don't count your stability and handiness as assets. Those things need to be her idea, as part of your reformation. You'll need to give up your life of mystery and danger -- no more getting drunk and brawling every weekend for instance. Once you've given those things up for her, then she can insist you become straight-up and good at fixing things.

  • Hannes (unregistered) in reply to Azarien
    Azarien:
    The real WTF is that in C# the empty string is not equal to null. It could have.

    So, string blabla="" and string blabla=null are the same in your opinion? Wow...

  • Maurizio (unregistered) in reply to Steve The Cynic

    http://www.lmgtfy.com/?q=dijstra+software+crisis

    Captcha: nobis: ora pro nobis !

  • Neil (unregistered)

    I believe databases exist that allow you to mark a text field as allowing null but non-null values must not be empty, thus giving rise to the scrubbing requirement, as form fields tend to perform the reverse replacement.

  • Terr (unregistered) in reply to fristman
    fristman:
    Strings are interned anyway, so there's probably not much memory to save

    No, String LITERALS, present in raw source code, are interned. (Doing it for all strings would be utterly ridiculous.)

    Since it is implied that this code is dealing with data coming in from the disk or network, they probably aren't interned.

    Making a copy isn't useful, since in the best case you've wasted a bit of runtime and in the worst-case you've wasted runtime and memory.

  • JRI (unregistered)

    Try setting name to " ". I bet the result isn't what is expected. Use String.IsNullOrWhiteSpace() or Trim() in the test.

Leave a comment on “A Scrubbing Bubble”

Log In or post as a guest

Replying to comment #:

« Return to Article