Re: Re[2]: terminating a system thread

Fine (sort of) then your reader thread has a loop, and as part of that loop
you read your boolean. Either you read it before or after your writer thread
writes it. Interlocking is not going to help here as it remains a fact that
either you read the value before it is written, or you read it after. If
your reader reads before it is written, well then next time around it will
read it after it is written. You do some dma work, read your flag, repeat
until asked to die.

Having a thread that is continuously busy, even when it perhaps has nothing
to do, is not such a good idea.

-----Original Message-----
From: rajinder sharma [mailto:xxxxx@hotmail.com]
Sent: Friday, May 18, 2001 2:34 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Re[2]: terminating a system thread

But my reader can not wait for any event. It is continuously processing data

and can not wait for any event. Its like continuously doing DMA and then
should be able to get terminated by some asynchronous event in some other
part of the driver.
thanks

If your writer writes the location and then sets the event, your reader
will
either wake up and then do the read AFTER the write occurs, or will have
already woken up for some other reason, do the read BEFORE the write
occurs,
but then when your reader does a wait on your event, it will still be set,
and consequently your reader will wake up and do the read AFTER the write.
You do not need an interlocked operation here, nor would it help.


Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


You are currently subscribed to ntdev as: xxxxx@stratus.com To
unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com


You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com