diff options
author | Sze Howe Koh <szehowe.koh@gmail.com> | 2013-09-10 21:08:01 +0800 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-14 02:58:57 +0200 |
commit | 2171b057e3e6273ae065b2754acec26887ad5ddf (patch) | |
tree | c3103dd39b9f169622f93c1eff9b00461fd1d228 /src | |
parent | 6780f76ee0e9122b8c15861a85fd29a908724d72 (diff) |
Doc: Remove section about how to start threads
- Incomplete: It doesn't talk about how to use a raw QThread, or
QRunnable, or Qt Concurrent.
- Redundant: Its contents are already presented in QThread's class ref,
and the line before this section links to the "Multithreading
Technologies in Qt" overview page which provides a more complete intro
Also remove snippet markers that are no longer used.
Change-Id: I89b7bd72f10c8ffdfd9b7772e2493050aafc9c88
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/doc/src/threads-basics.qdoc | 39 |
1 files changed, 3 insertions, 36 deletions
diff --git a/src/corelib/doc/src/threads-basics.qdoc b/src/corelib/doc/src/threads-basics.qdoc index 353906f11a..5a5c003210 100644 --- a/src/corelib/doc/src/threads-basics.qdoc +++ b/src/corelib/doc/src/threads-basics.qdoc @@ -179,42 +179,9 @@ \section1 Qt Thread Basics - QThread is a very convenient cross platform abstraction of native platform - threads. Starting a thread is very simple. Let us look at a short piece of - code that generates another thread which says hello in that thread and then - exits. - - \snippet ../widgets/tutorials/threads/hellothread/hellothread.h 1 - - We derive a class from QThread and reimplement the \l{QThread::}{run()} - method. - - \snippet ../widgets/tutorials/threads/hellothread/hellothread.cpp 1 - - The run method contains the code that will be run in a separate thread. In - this example, a message containing the thread ID will be printed. - QThread::start() will call the method in another thread. - - \snippet ../widgets/tutorials/threads/hellothread/main.cpp 1 - - To start the thread, our thread object needs to be instantiated. The - \l{QThread::}{start()} method creates a new thread and calls the - reimplemented \l{QThread::}{run()} method in this new thread. Right after - \l{QThread::}{start()} is called, two program counters walk through the - program code. The main function starts with only the GUI thread running and - it should terminate with only the GUI thread running. Exiting the program - when another thread is still busy is a programming error, and therefore, - wait is called which blocks the calling thread until the - \l{QThread::}{run()} method has completed. - - This is the result of running the code: - - \code - //bad code - hello from GUI thread 3079423696 - hello from worker thread 3076111216 - \endcode - + The following sections describe how QObjects interact with threads, how + programs can safely access data from multiple threads, and how asynchronous + execution produces results without blocking a thread. \section2 QObject and Threads |