On 17.07.23 19:01, Luca Olivetti via lazarus wrote:
Hello,

TThread.Queue and Application.QueueAsyncCall more or less do the same thing (even if they use two different queues that are managed at different times in the main thread).

When it's better to use one or the other?

Application.QueueAsyncCall has a Data: PtrInt parameter to pass some context and it is always called later, so this is useful for doing something after the current LCL event. TThread.Queue has aThread parameter, so the call is removed when the thread is freed, and when you call it from the main thread it will execute immediately, so this is for worker threads to asynchronously do something in the main thread.


Mattias

--
_______________________________________________
lazarus mailing list
[email protected]
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to