Overlapped Serial Ports and buffering

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



I'm writing a serial port class. My team lead said that when using
simple, non-overlapped I/O on Windows 2000, they found that doing 1 and
2 byte reads caused a significant peak in CPU utilization. (All our
packets are read with a 1 byte, then either a 1 or 2 byte read then a
lengthy read.) Do reduce this, they double buffered the reads.

I converted the class to use basic OVERLAPPED I/O. I wrote 2 versions
of the class; one uses straight reads, the other reads the data in
chunks and queues it up for the reader.

When testing both, I found that the process utilization was the same on
average. Does anyone know if OVERLAPPED I/O is already buffering serial
port reads? (Do serial port reads even make a ring transition at the
driver level? Did this possibly change between Windows 2000 and Windows
XP?)

.



Relevant Pages

  • Re: Newbie Needs Ada Advice
    ... the serial port with regular Windows calls. ... Do you have an Ada binding for the Windows serial port driver that ... Windows API CreateFile / ReadFile / WriteFile do overlapped I/O for all ...
    (comp.lang.ada)
  • Re: Asynch COM under Win98
    ... I am mostly not a Windows programmer however about 3 years ago I wrote an MFC ... GUI control program that did serial I/O and our objective was to be compatible ... another view states that serial overlapped I/O works in W9X but non-serial ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Flow Control on Serial Device
    ... I found out that if I just reboot my pc from Windows to Linux ttyS0 behaves ... Then I see in Linux the same status as in WT: rts on, ... means your serial port is not active... ...
    (comp.os.linux.networking)
  • Re: Multimedia Timer
    ... First, as already observed, WIndows is *not* a real-time system, and 20ms events are ... Does the recipient of the serial port data need to receive one "chunk" ... delete buffer; ... That's because I need those 20ms delay between two requests. ...
    (microsoft.public.vc.mfc)
  • Re: Flow Control on Serial Device
    ... I use exactly the same cable as with the windows program. ... I also tried to set RTS on and off via ioctl, ... indeed a straight through cable? ... properly configure your serial port, ...
    (comp.os.linux.networking)