Skip to Main Content
Mastering Delphi Programming: A Complete Reference Guide
book

Mastering Delphi Programming: A Complete Reference Guide

by Primož Gabrijelčič
November 2019
Beginner to intermediate content levelBeginner to intermediate
674 pages
15h
English
Packt Publishing
Content preview from Mastering Delphi Programming: A Complete Reference Guide

Queue and Synchronize

The second (and third) messaging option provided by Delphi is to use TThread.Queue or TThread.Synchronize. As they are just variations of the same concept, I'll describe them together.

Unlike Windows messages, which can be sent from the main thread to a background thread if you write the background thread in an appropriate way, Queue and Synchronize don't provide any support for that. You can only use them to send messages to the main thread.

The beauty of Queue and Synchronize is that they are completely platform independent. Delphi's RTL makes sure that you can use them with VCL or FireMonkey on any of their supported platforms.

If you want to use Queue or Synchronize in a console application, your application must ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Delphi GUI Programming with FireMonkey

Delphi GUI Programming with FireMonkey

Andrea Magni
Delphi Cookbook - Third Edition

Delphi Cookbook - Third Edition

Daniele Spinetti, Daniele Teti

Publisher Resources

ISBN: 9781838989118Other