… besides, OS can hardly survive staying at raised IRQL longer than 25
msec. Well, if I remember correctly a discussion on that topic years ago
…
-----Original Message-----
From: Peter Wieland [mailto:xxxxx@windows.microsoft.com]
Sent: Monday, October 20, 2003 9:38 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] RE: About delay in completion routine
you should not block for a 1/10th of a second in a completion routine
using any mechanism. THese are often called at DISPATCH_LEVEL in which
case no other thread will be allowed to run while you hog the CPU
waiting (the KeDelayExecutionThread function is not an option because it
cannot be invoked at dispatch level).
if you need to defer the completion of the request for some reason you
should initialize a timer when you receive the request, set it in the
completion routine and return STATUS_MORE_PROCESSING_REQUIRED to end the
completion. The DPC for the timer will run in 100ms and you can
complete the request there.
-p
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of David Lee
Sent: Monday, October 20, 2003 7:40 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] RE: About delay in completion routine
arlie,
thanks, I misunderstood you since I beleived that I can not use
timeGetTime() function.
Now I see.
Say again , thank you very much
David
From: “Arlie Davis”
>Reply-To: “Windows System Software Devs Interest List”
>
>To: “Windows System Software Devs Interest List”
>Subject: [ntdev] RE: About delay in completion routine
>Date: Mon, 20 Oct 2003 22:33:39 -0400
>
>Because you are programming for a multi-user, multi-processor,
>multi-process environment. Spin loops are completely inappropriate for
>this environment. The reasons why are so obvious that I won’t go into
>them here. (Spin loops waste processor time, work against the process
>scheduler, dramatically increase processor power drain in low-power
>devices, etc.)
>
>If you do not understand why a spin loop like this is inappropriate,
>you need to do a lot of reading on modern operating system design. I
>don’t intend for this to be condescending, merely true.
>
>– arlie
>
>
>-----Original Message-----
>From: xxxxx@lists.osr.com
>[mailto:xxxxx@lists.osr.com] On Behalf Of David Lee
>Sent: Monday, October 20, 2003 10:22 PM
>To: Windows System Software Devs Interest List
>Subject: [ntdev] RE: About delay in completion routine
>
>
>
>arlie,
>thanks, can you tell me why the “DOS” function can not be used?
>
>regards
>
>David
>
>
> >From: “Arlie Davis”
> >Reply-To: “Windows System Software Devs Interest List”
> >
> >To: “Windows System Software Devs Interest List”
> >
> >Subject: [ntdev] RE: About delay in completion routine
> >Date: Mon, 20 Oct 2003 21:59:01 -0400
> >
> >Please, please, please do not do this. Habits like this from DOS
> >days
> >must be abandoned. Your customers, other developers, and I will
> >all hate you.
> >
> >If you must block a thread for a fixed time period, use
> >KeDelayExecutionThread (kernel-mode) or SleepEx (user-mode).
> >
> >– arlie
> >
> >
> >-----Original Message-----
> >From: xxxxx@lists.osr.com
> >[mailto:xxxxx@lists.osr.com] On Behalf Of David Lee
> >Sent: Monday, October 20, 2003 9:08 PM
> >To: Windows System Software Devs Interest List
> >Subject: [ntdev] About delay in completion routine
> >
> >
> >Hi, All,
> >
> >I have a question about delay in completion routine. So far I used
> >timeGetTime funtion. My source code is as follows in my completion
> >routine.
> >
> >DWORD PreviouseTime;
> >
> >…
> >PreviouseTime=timeGetTime(); while(timeGetTime()-PreviouseTime<100)//
> >100ms delay { }
> >
> >So far it looks like working. However, I have no much time to
testing.
> >Anybody can tell me. has it side effect using in Completion Routine.
> >
> >Thanks
> >
> >David
>
>
>—
>Questions? First check the Kernel Driver FAQ at
>http://www.osronline.com/article.cfm?id=256
>
>You are currently subscribed to ntdev as: xxxxx@hotmail.com To
>unsubscribe send a blank email to xxxxx@lists.osr.com
_________________________________________________________________
Get a FREE computer virus scan online from McAfee.
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@microsoft.com To
unsubscribe send a blank email to xxxxx@lists.osr.com
—
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as:
xxxxx@borland.com
To unsubscribe send a blank email to xxxxx@lists.osr.com