[Lazarus] SdpoSerial Tx and Rx buffers?

Bo Berglund bo.berglund at gmail.com
Fri Feb 18 14:43:29 CET 2011


On Fri, 18 Feb 2011 09:11:14 +0100, Michael Schnell
<mschnell at lumino.de> wrote:

>On 02/17/2011 05:46 PM, Bo Berglund wrote:
>>
>> At least in the embedded world UART:s have *both* a transmit and
>> receive FIFO.
>Same with PCs. And AFAIK, the OS-driver adds a huge Fifo buffer in both 
>directions to allow for the quite latency userland software to work as 
>good as possible without degrading the transmission performance.
>

But then we have the problem I have already detected when test running
my SdpoSerial based application:
If I set it up to send a large chunk of data and put a breakpoint at
the WriteData call so I can time the process when I click step-over I
see this:
Data size 100.000 bytes
Baudrate: 38400
Estimated shortest time for transfer: 26 s
Time to return from call: about 30 s

So this means that even if the OS has a "huge" buffer for outgoing
data it fails to improve the call time of the blocking call to
WriteData.
My initial question was about adjustment of the size of the transmuĂ­t
buffer such that I could ensure safe transfer of the data and snappy
response in my application.
As it is now the GUI will die when the transfer is made.
I have to somehow adapt to this fact and add a buffer layer myself in
a thread that feeds data to the WriteData method.

-- 

Bo Berglund
Developer in Sweden





More information about the Lazarus mailing list