Microsecond delay in Windows

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hello Experts,

In my Win32 application, I need to induce a delay in microsecond. I knew
that it is pretty impossible in Windows 'coz of its multi-tasking nature.

My application's requirement is like this =>

Pesudocode TransmitMessageThread:

While(n times) {
1. Pick a message from TransmitMessageQueue.
2. Send the Message onto the custom N/W (N/W speed is 10MBps)
3. Provide a microsecond delay
n - - ;
}

After some exploration, I got the following (sloppy) solutions.

1. Set the priority of the process to "REALTIME_PRIORITY_CLASS" using
SetPriorityClass.
2. Write a driver routine which will simply induce the required delay in
microseconds.
3. Explore real time extensions for Windows to find out the solution.

I knew that solution #1 simply wont work 'coz the process will be in User
space and time required to do anything in user space is completely
unpredictable hence solution no#1 is ruled out.

I have absolutely no idea about the feasibility of solutions #2 & #3.

"it is only barely possible to have a device driver defeat the scheduler,
and it can do
this only while in the driver, and for a period not exceeding 25us" .even
this statement from an expert vapourises even the last hope I had.

I am literally aware that I'm asking the impossible..Still, Is there any way
out there???
Is there any way I can induce microsecond delay in my Windows application?
It's acceptible for me that to obtain the delay in microsecond the
multi-tasking ability of the Windows needs to be disabled!!! for some
definite interval of time.

Eagerly awaiting for a very positive response :))

Best Regards,
Arun


.



Relevant Pages

  • Re: Microsecond delay in Windows
    ... I need to induce a delay in microsecond. ... Explore real time extensions for Windows to find out the solution. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Microsecond delay in Windows?
    ... Windows SDK MVP ... Exit the loop once the counter difference reaches the desired number ... I need to induce a delay in microsecond. ...
    (microsoft.public.win32.programmer.kernel)
  • Microsecond delay in Windows
    ... I need to induce a delay in microsecond. ... Explore real time extensions for Windows to find out the solution. ...
    (microsoft.public.win32.programmer.kernel)
  • Microsecond delay in Windows?
    ... I need to induce a delay in microsecond. ... Explore real time extensions for Windows to find out the solution. ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Kernel mode programming in VC++
    ... I need to induce a delay in microsecond. ... that it is pretty impossible in Windows 'coz of its multi-tasking nature. ... jmp short $+2 ...
    (microsoft.public.vc.mfc)