Re: ReaderWriterLockSlim + Dispose?
- From: NvrBst <nvrbst@xxxxxxxxx>
- Date: Mon, 7 Apr 2008 11:01:48 -0700 (PDT)
On Apr 6, 7:53 pm, "Peter Duniho" <NpOeStPe...@xxxxxxxxxxxxxxxx>
wrote:
As I noted in my other post, wrapping the call in a try/catch doesn't
address the underlying design issue, nor does it any way validate the
design choice. That said, I find it amusing that you don't like the idea
of aborting a thread (as well you shouldn't), but you're perfectly happy
to have it throw an exception that you catch and use to terminate the
thread. There's very little difference between the two approaches.
Amusing, are there any other requirments? Am I allowed to use if
statments? :) Its a joke :P. You say "it doesn't crash", but thats
not just the case, you should be saying "it doesn't crash, and
maintains the strick sychronization requirments", and all other
requirments/functions of the program for that matter, with no
possibility of ill effects. It does exactly what the client paid for,
and doesn't have any dead weights running around.
I don't know why you wouldn't call it a valid design, it uses a
boolean to check the object before using it, and in the rare case of
object being disposed between the ")", then it does whatever cleanup
the thread might want to do, and exit, in a valid way to maintain
sychronization.
From what your saying here it's like you've never opened a file in
your life as a programmer (which is the same design pattern as I'm
using). You check the file to see if its valid, and then open it.
Can something grab the file between the check and opening? Definally,
does it make it a bad design? Definally not.
You show me a method of opening a file without a try/catch statment
that doesn't crash, and I'll show you how to check for use of a
disposable object that can be disposed anytime.
Rest of your statments are just plaintly close minded. Telling people
there is no way to do something (correctly), is extremly ignorant, "I
hope no one is paying you for your coding efforts then" with that kind
of mindset, a real programmer see's a problem, and accoplish's it. He
doesn't whine about a try/catch statment, he whines about the
performance/robustness/correctness (problem wise) of a solution.
NB
PS: I'm not saying this is the only way to do things. I've made
programes with all three techniques mentioned here and will agree that
signling threads to finish and waiting for them to finish to dispose
is one way to do it. It doesn't make it the best way for all cases in
the world... unlike your mindset, the world is not that small of a
place.
.
- Follow-Ups:
- Re: ReaderWriterLockSlim + Dispose?
- From: Peter Duniho
- Re: ReaderWriterLockSlim + Dispose?
- References:
- ReaderWriterLockSlim + Dispose?
- From: NvrBst
- Re: ReaderWriterLockSlim + Dispose?
- From: NvrBst
- Re: ReaderWriterLockSlim + Dispose?
- From: Peter Duniho
- Re: ReaderWriterLockSlim + Dispose?
- From: NvrBst
- Re: ReaderWriterLockSlim + Dispose?
- From: Peter Duniho
- Re: ReaderWriterLockSlim + Dispose?
- From: NvrBst
- Re: ReaderWriterLockSlim + Dispose?
- From: Peter Duniho
- Re: ReaderWriterLockSlim + Dispose?
- From: NvrBst
- Re: ReaderWriterLockSlim + Dispose?
- From: Peter Duniho
- Re: ReaderWriterLockSlim + Dispose?
- From: NvrBst
- Re: ReaderWriterLockSlim + Dispose?
- From: Peter Duniho
- Re: ReaderWriterLockSlim + Dispose?
- From: NvrBst
- Re: ReaderWriterLockSlim + Dispose?
- From: Peter Duniho
- Re: ReaderWriterLockSlim + Dispose?
- From: NvrBst
- Re: ReaderWriterLockSlim + Dispose?
- From: Peter Duniho
- ReaderWriterLockSlim + Dispose?
- Prev by Date: RE: property in an interface
- Next by Date: which implement interface to use
- Previous by thread: Re: ReaderWriterLockSlim + Dispose?
- Next by thread: Re: ReaderWriterLockSlim + Dispose?
- Index(es):
Relevant Pages
|