Re: Deadlocks
Re: Deadlocks
- Subject: Re: Deadlocks
- From: Steven Mark McCraw <email@hidden>
- Date: Wed, 5 Sep 2007 20:22:42 -0400
Is it easy? Or is that just the nature of the concurrency beast?
I consider it easy because I've had to deal with it so many times. I
think WebObjects seems worse than a normal multithreaded app because
things you do that are totally unrelated to concurrency from the
programmer's point of view can cause you deadlock. It's nice that so
much of the concurrency-handling misery you would ordinarily have to
think about with multithreaded applications is hidden from you, but
when it goes wrong, it is the height of confusion.
The one thing I can think of that WO could have added is some
try...catch or try...finally blocks in WOSession. These could, if
present, handle when the developer does not properly handle the
exceptions that happen in their code.
Can you think of anything else that could be done?
I once encountered an infinite loop in a piece of sample code that I
got from a WWDC session which I pasted into my production code like
an idiot without thoroughly reviewing it first. This led to a
deadlock which disguised the infinite loop nicely so that it took me
forever to track down. As I understand it (and it's been a really
long time since I looked into all the possibilities of how things can
deadlock), the thing you mention (adding try-catch blocks in Session)
covers all of the issues I can think of off the top of my head (but
this is a big area: unhandled exceptions, especially in java, is a
huge pool of possibility), and this would be nice, because you could
just log an exception and fix it instead of having your app crash in
a hard to diagnose way which masks the improperly handled exception
in the first place.
Once you get used to seeing a deadlock and know how to diagnose it,
it really isn't that horrible. But the fact that they're frequent
enough to make me good at diagnosing them makes me feel that they are
easy to generate. I would chalk this up to developer incompetence on
my own part (and there may still be a hint of accuracy there ;-P) but
I've seen enough deadlocking grief on the mailing lists and from
other WO developers I've talked to to make me feel like it isn't just
me. I agree that a lot of the issues seem to have been fixed, and
project wonder's automatic locking saves me both from nonstop tedious
locking/unlocking and all the deadlocking conditions I used to
encounter when I slipped up dealing with the tedium. It just leaves
a bitter mark and a bit of a bias on those of us who experienced
things before they were fixed.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden