Re: Thread Pre-Emption Question . . .



BTW: Running successfully does not _prove_ anything about the correctness
of a piece of software. It does demonstrate that any errors have low
(possibly zero) occurrence probability within the operating environment.



A failure does prove something about the correctness of a piece of
software - specifically that it is not correct ;)





That being said, I have not reviewed you code in detail; but it does seem
odd. And it is defiantly possible to construct a shared read, exclusive
write lock that allows acquisition of a read lock without always calling
WFXO.



As to the OP's problem (if he's even still listening): In general, one can't
know what is happening during a time when your thread(s) aren't running - if
you think about this, then it will become clear why Windows is not a RTOS
and why your task, unless it is a debugging / tuning process, is not
possible without OS / hardware support. If this is to debug a problem where
'sometimes the XXX hiccups because it took more than 40 ms', then run a test
with a large number of calls to your time critical function and use
GetThreadfTimes (or QueryPerformanceCounter or even perfmon) to compute the
average time required for each call and see if it is close to 40 ms. If it
is, then you have a problem; if it isn't then it is some other task on the
OS (IDE driver?) that is causing your problem.



The def'n of close depends on the reliability that you require. If you want
to quantify the probability of failure for a given call on a given hardware
and software platform, then you can take a large number of estimates of the
time required for one call (QueryPerformanceCounter) and, assuming
exponential distribution, analyze the distribution and compute the
probability (Excel can do the easily to a reasonable accuracy).


"Pops" <dude@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:OUaVKGwIIHA.4272@xxxxxxxxxxxxxxxxxxxxxxx
Chris Thomasson wrote:

Your rw-mutex has way too much overhead for read access. You don't need
to acquire a lock (e.g., WriterMutex) in your ReadEnter/Leave functions.
Here is an example of how you can do it:

http://groups.google.com/group/comp.programming.threads/msg/cfdc3cec444b5544

Oh I see, you wanted to show us YOUR OWN WORK.

Cool.

Unfortunately, I can't trust your work until you can prove your
credentials and tell me where do you have this implemented and tested
under high loads. What products do you have this implemented in?

Also, what are your TCriticalSection::Check/Count functions used for?
Functions like that are usually a sign of poor design. The results you
get from those functions are not coherent wrt the current state of the
lock at any one time.

Baloney.

The fact our products are used by hundreds of thousands of customer for
nearly 12 years under 365x24x7 operating conditions, uncategorically
proves without the shadow of a double the HIGH QUALITY of the RPC
server/client system with absolutely NO multi-threads contention
conflicts.

Now, if you want to show HOW we can run into a problem with an example, I
am willing to listen. I'm too old to have regrets and have no problem is
there is a potential hidden issue. But I am not going to take YOUR blurted
out claims that your CODE is any better or worst. You have to prove it.

--
HLS


.



Relevant Pages

  • Re: CMutex /CEvent (multiple threads)
    ... mutex, is that these sections modify some data, and that this ... Locking primitives say a LOT about data correctness. ... Crash is a crash and it has to ... is only "successful acquisition of the lock", and THROWING AWAY the critical information ...
    (microsoft.public.vc.mfc)
  • quality asurance problem....
    ... provides the probability of correctness of an element; ... element of which the test estimate a probability of correctness of 75% ... How to calculate the actual quality of the entire set of elements? ...
    (sci.stat.math)
  • Re: How to check if file exists ?
    ... Which all probably require opening a file and having a lock on it (that's ... enough to ensure correctness for any lock or semaphore scenario. ... already exists in the destination folder it suggests Untitled-1 or some ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Hey, stop picking that lock!
    ... watch_on_duty() in monmove.c says that the watch will notice if ... a lock with probability 1/3 on any given turn. ... On rare occasions the unlock attempt will fail on the ...
    (rec.games.roguelike.nethack)
  • Re: Reading from and writing simultaniously to graphics card
    ... entire purpose of Lock, to synchronize access and guarantee data ... correctness. ...
    (microsoft.public.win32.programmer.directx.graphics)