Moacir Flávio Gonçalves wrote:
[]
> The question is: What is that 1ms between receive and next send?

The bland answer is that Windows is not a real-time OS.  Consider what 
happens:

- character is received
- operating system changes from user mode to kernel mode
- operating system detects the interrupt from the port controller
- operating system handles the interrupt
- determines it is for your process
- boosts the priority of your process
- determines which is the next scheduled process to run (might not be 
yours)
- wakes up your process
- schedules it for running
- your process completes any I/O in kernel mode
- may require the data to be moved from system space to user space
- your process does its stuff
- your process queues an I/O request for the system
- system moves data from your space to system space
- system starts the I/O for you

The same process applies (broadly) whether you receive one character or 16 
(think of the buffering in the UART).

I'm sure there are tweaks you can make to improve the throughput, but a 
single character at a time is about the worst possible case.

I also recall some peculiarities about response times at different baud 
rates.  You may want to check try different baud rates and see what 
happens.  Sorry but I don't have any references for this effect right now.

Cheers,
David 

_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to