[fpc-pascal] TThread.Queue vs TThread.Synchronize

Graeme Geldenhuys mailinglists at geldenhuys.co.uk
Mon Feb 23 11:08:45 CET 2015


I've recently seen some posts in Delphi groups that the preferred way is
to use TThread.Queue instead of TThread.Synchronize.

Why is that? What are the benefits?

I've look at FPC trunk and see we now have a Queue() implementation, and
I adjusted a simple multi-threaded GUI example app I had. But I still
don't really understand what is the benefit of Queue vs Synchronise. I
still had to create a "synchronise method" which I pass in to Queue() -
similar to what I did for Synchronize().

Also how is Queue() calls processed? For example to get Synchronize() to
work I had to call CheckSynchronize in my main event loop. Is this also
required for Queue() functionality?

  - Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal

More information about the fpc-pascal mailing list