Multithreading in Qt

A thread is a single line of execution within a single application. Nearly all of today's operating systems are multithreaded; that is, your application can have more than one concurrent line of execution at a time. Multithreading is a key way to improve the responsiveness of an application, because most processors today can execute multiple threads in parallel and operating systems are optimized to share resources among multiple threads.

Qt supports multithreading over the host operating system through three key classes:

  • QThread
  • QSemaphore
  • QMutex

The first represents a single thread of execution, while the latter two are used to synchronize thread access to data structures.

By design, your application runs entirely on the user ...

Get Application Development with Qt Creator - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.