Re: Thread Pre-Emption Question . . .
- From: Pops <dude@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 09 Nov 2007 18:41:59 -0500
m wrote:
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.
Of course, but one to say our critsect.h classes is the premise for flawed code, is false. And I think that I should know our products and its long time usage it the market place by thousands of corporate companies under 365x34x7 operations who after 12 years, BY now would of produce errors related to critsect.h simple b because this is a fundamental critical concept for the product RPC client/server muilt-threaded operations. This is simply not the case. critsect.h is fine.
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.
Read the code and the original OP needs. My suggestion for a solution.
He needs a FAST THREAD that works under 40ms.
The suggestion is to queue up data for the signaling to this thread and allow a 2nd or multiple threads to process the queue.
The example code is a MULTIPLE WRITER, SINGLE READER design, and the READER/WRITER logic is fine.
However, as noted, if there is a need for multiple readers, maybe because the queue is building up too fast, then absolutely, a sync on the reading is required.
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.
Windows is not a RTOS because it can not provide the #1 fundamental rule in a RTOS - constant residence time for all threads. That is the basic definition of a RTOS - equal time slicing.
Thanks for your comments.
--
HLS
.
- Follow-Ups:
- Re: Thread Pre-Emption Question . . .
- From: m
- Re: Thread Pre-Emption Question . . .
- From: Chris Thomasson
- Re: Thread Pre-Emption Question . . .
- References:
- Re: Thread Pre-Emption Question . . .
- From: Pops
- Re: Thread Pre-Emption Question . . .
- From: Pops
- Re: Thread Pre-Emption Question . . .
- From: Pops
- Re: Thread Pre-Emption Question . . .
- From: Pops
- Re: Thread Pre-Emption Question . . .
- From: m
- Re: Thread Pre-Emption Question . . .
- Prev by Date: Re: Thread Pre-Emption Question . . .
- Next by Date: Re: Thread Pre-Emption Question . . .
- Previous by thread: Re: Thread Pre-Emption Question . . .
- Next by thread: Re: Thread Pre-Emption Question . . .
- Index(es):
Relevant Pages
|