Michael Schnell wrote:
On 01/21/2016 11:38 AM, Mark Morgan Lloyd wrote:

That of course is a significant issue.

I don't see what could prevent this from working.

I didn't say anything wouldn't work.

The simple method would be to create a new buffer for the data to be transferred to the main thread and copy the data already received in a "static buffer" there.

If you want to avoid copying you could transfer the data in the receive buffer (which later would be freed) and allocate a new receive buffer for the next receive.

I don't understand  the "OS" issue, that you speak of .

Copying data tends to introduce a significant performance hit, which is why many OSes try to avoid it by passing pointers. The typical result of passing pointers is to introduce the possibility of buffer overflows, because the lower-level (and more privileged) code doesn't (or can't) apply application-specific tests.

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to