[Lazarus] AsyncProcess code problem

Steve Gatenby steveg at nevets.com.au
Fri Jun 9 10:55:14 CEST 2017



On 06/09/2017 05:32 PM, Mattias Gaertner via Lazarus wrote:
> On Fri, 9 Jun 2017 17:08:25 +0930
> Steve Gatenby via Lazarus <lazarus at lists.lazarus-ide.org> wrote:
>
>> Having a problem with some code here :)
>>
>> Lazarus 1.9.0 r55266M FPC 3.1.1 x86_64-linux-gtk2
>>
>> I create a thread every second to run a process (TAsyncprocess), then
>> FreeAndNil the process once done.
> If you are using threads, then why use TAsyncProcess?
> TAsyncProcess was invented as a non blocking TProcess for the main
> thread.
> Probably it can be made thread safe for the gtk2 interface, but
> if you already use threads, then you can simply use TProcess or
> TProcessUTF8 with less overhead.
>
>
> Mattias
Thanks Mattias - I will change to TProcess and see how it goes.



More information about the Lazarus mailing list