[Lazarus] [LAZARUS] Any Free/Cheap Async Serial Port Component

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Thu Apr 3 12:53:16 CEST 2014


Michael Schnell wrote:
> On 04/02/2014 10:53 PM, Roberto P. wrote:
>> I'd like to point out that CPortLaz is multithreaded
> 
> Does it work similar to AsyncPro ?
> 
> In fact, IMHO, it would be desirable to have a component that 
> _internally_ uses TThread to handle blocking ports (either using just a 
> byte-FIDO - this is what AsyncPro does - and/or allowing the user to 

I agree. My mods to serial.pp were accepted into trunk a few weeks ago, 
but that is explicitly unthreaded since it's intended as the lowest 
layer for cases where- as an example- timestamps or changes to physical 
control lines need to be enqueued with the character stream.

> implement a protocol within the Thread's "Execute" ), and when some 
> information from the port is received (at least one byte or when the 
> protocol handler issues a "ready"), does an Event (aka queued callback) 
> to the main thread.

With the caveat that this sort of thing needs to be implemented very 
carefully so that it can interwork with e.g. a terminal emulator 
component. I think the two would need to be designed together, even if 
in practice one was coded first.

Until then, FPC's thread handling is sufficiently good that an 
application-specific hack isn't particularly difficult.

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

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




More information about the Lazarus mailing list